整理

上级 d05ab7e8
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -281,7 +281,7 @@ export default { ...@@ -281,7 +281,7 @@ export default {
async addQuestion(addType) { async addQuestion(addType) {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/add', { const { data: res } = await axios.post('http://localhost:8888/algorithmicProblem/add', {
addType: addType, addType: addType,
questionName: this.form.questionName, questionName: this.form.questionName,
questionType: this.form.questionType, questionType: this.form.questionType,
...@@ -322,7 +322,7 @@ export default { ...@@ -322,7 +322,7 @@ export default {
async editConfirm() { async editConfirm() {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/update', { const { data: res } = await axios.post('http://localhost:8888/algorithmicProblem/update', {
id: this.currentRowId, id: this.currentRowId,
questionName: this.form.questionName, questionName: this.form.questionName,
questionType: this.form.questionType, questionType: this.form.questionType,
...@@ -352,7 +352,7 @@ export default { ...@@ -352,7 +352,7 @@ export default {
async onDelete(id) { async onDelete(id) {
this.dialogVisible = false this.dialogVisible = false
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/delete', { const { data: res } = await axios.get('http://localhost:8888/algorithmicProblem/delete', {
params: { params: {
id: id, id: id,
}, },
...@@ -367,7 +367,7 @@ export default { ...@@ -367,7 +367,7 @@ export default {
}, },
async getQuestionType() { async getQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/questionType', { params: {} }) const { data: res } = await axios.get('http://localhost:8888/algorithmicProblem/questionType', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.options = res.result this.options = res.result
console.log(this.options) console.log(this.options)
...@@ -377,7 +377,7 @@ export default { ...@@ -377,7 +377,7 @@ export default {
}, },
async getAllQuestionType() { async getAllQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/allQuestionType', { params: {} }) const { data: res } = await axios.get('http://localhost:8888/algorithmicProblem/allQuestionType', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.allOptions = res.result this.allOptions = res.result
} }
...@@ -385,7 +385,7 @@ export default { ...@@ -385,7 +385,7 @@ export default {
async interviewPage() { async interviewPage() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/page', { const { data: res } = await axios.get('http://localhost:8888/algorithmicProblem/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
...@@ -410,7 +410,7 @@ export default { ...@@ -410,7 +410,7 @@ export default {
}, },
async interviewRandom() { async interviewRandom() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/random', { params: {} }) const { data: res } = await axios.get('http://localhost:8888/algorithmicProblem/random', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.randomAlgorithmic.questionName = res.result.questionName this.randomAlgorithmic.questionName = res.result.questionName
this.randomAlgorithmic.leetcodeNumber = res.result.leetcodeNumber this.randomAlgorithmic.leetcodeNumber = res.result.leetcodeNumber
......
...@@ -192,7 +192,7 @@ export default { ...@@ -192,7 +192,7 @@ export default {
async addQuestion(addType) { async addQuestion(addType) {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/aphorismPoetry/add', { const { data: res } = await axios.post('http://localhost:8888/aphorismPoetry/add', {
addType: addType, addType: addType,
poetryText: this.form.poetryText, poetryText: this.form.poetryText,
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
async editConfirm() { async editConfirm() {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/aphorismPoetry/update', { const { data: res } = await axios.post('http://localhost:8888/aphorismPoetry/update', {
id: this.currentRowId, id: this.currentRowId,
poetryText: this.form.poetryText, poetryText: this.form.poetryText,
}) })
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
async onDelete(id) { async onDelete(id) {
this.dialogVisible = false this.dialogVisible = false
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/delete', { const { data: res } = await axios.get('http://localhost:8888/aphorismPoetry/delete', {
params: { params: {
id: id, id: id,
}, },
...@@ -265,7 +265,7 @@ export default { ...@@ -265,7 +265,7 @@ export default {
}, },
async interviewPage() { async interviewPage() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/page', { const { data: res } = await axios.get('http://localhost:8888/aphorismPoetry/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
...@@ -280,7 +280,7 @@ export default { ...@@ -280,7 +280,7 @@ export default {
}, },
async interviewRandom() { async interviewRandom() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/random', { params: {} }) const { data: res } = await axios.get('http://localhost:8888/aphorismPoetry/random', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.randomAlgorithmic.poetryText = res.result.poetryText this.randomAlgorithmic.poetryText = res.result.poetryText
} }
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
methods: { methods: {
async onDelete(id) { async onDelete(id) {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/chatbot/delete', { const { data: res } = await axios.get('http://localhost:8888/chatbot/delete', {
params: { params: {
id: id, id: id,
}, },
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
async initCartList() { async initCartList() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/chatbot/page', { const { data: res } = await axios.get('http://localhost:8888/chatbot/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
......
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
<el-form-item> <el-form-item>
<el-button type="primary" @click="prepareMutiAdd">批量新增</el-button> <el-button type="primary" @click="prepareMutiAdd">批量新增</el-button>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" @click="allTriplet">三连</el-button>
</el-form-item>
</el-form> </el-form>
<el-table border :data="csdnUserList" v-loading="loading"> <el-table border :data="csdnUserList" v-loading="loading">
<el-table-column prop="userName" label="用户名称" show-overflow-tooltip></el-table-column> <el-table-column prop="userName" label="用户名称" show-overflow-tooltip></el-table-column>
...@@ -59,20 +62,22 @@ ...@@ -59,20 +62,22 @@
<el-table-column prop="commentStatusName" label="评论状态" show-overflow-tooltip></el-table-column> <el-table-column prop="commentStatusName" label="评论状态" show-overflow-tooltip></el-table-column>
<el-table-column prop="userWeightName" label="用户权重" show-overflow-tooltip></el-table-column> <el-table-column prop="userWeightName" label="用户权重" show-overflow-tooltip></el-table-column>
<el-table-column prop="articleType" label="文章类型" show-overflow-tooltip :width="100"></el-table-column> <el-table-column prop="articleType" label="文章类型" show-overflow-tooltip></el-table-column>
<el-table-column label="更新时间">
<el-table-column label="创建时间" width="170">
<template slot-scope="props">
{{ props.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="更新时间" width="170">
<template slot-scope="props"> <template slot-scope="props">
{{ props.row.updateTime | dateFormat }} {{ props.row.updateTime | dateFormat }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="操作" label="操作" width="180"> <el-table-column prop="操作" label="操作" width="250px">
<template slot-scope="props"> <template slot-scope="props">
<el-button type="primary" @click="prepareTriplet(props.row.userName)">三连</el-button>
<el-dialog title="提示" :visible.sync="tripletVisible" width="30%" :before-close="handleClose">
<span>确认三连?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="tripletVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="triplet(currentUserName)">确 定</el-button>
</span>
</el-dialog>
<el-button type="success" @click.prevent="preEdit(props.row.id, props.row.userName, props.row.nickName, props.row.userWeight)" width="200">编辑</el-button> <el-button type="success" @click.prevent="preEdit(props.row.id, props.row.userName, props.row.nickName, props.row.userWeight)" width="200">编辑</el-button>
<el-dialog title="编辑用户信息" :visible.sync="editVisible"> <el-dialog title="编辑用户信息" :visible.sync="editVisible">
<el-form :model="form"> <el-form :model="form">
...@@ -171,6 +176,7 @@ export default { ...@@ -171,6 +176,7 @@ export default {
dialogMutiFormVisible: false, dialogMutiFormVisible: false,
dialogVisible: false, dialogVisible: false,
editVisible: false, editVisible: false,
tripletVisible: false,
// 用户列表数据 // 用户列表数据
csdnUserList: [], csdnUserList: [],
loading: false, loading: false,
...@@ -181,6 +187,7 @@ export default { ...@@ -181,6 +187,7 @@ export default {
// 新增的内容 // 新增的内容
formLabelWidth: '120px', formLabelWidth: '120px',
currentRowId: null, currentRowId: null,
currentUserName: null,
} }
}, },
watch: { watch: {
...@@ -224,6 +231,10 @@ export default { ...@@ -224,6 +231,10 @@ export default {
this.currentRowId = id this.currentRowId = id
this.dialogVisible = true this.dialogVisible = true
}, },
prepareTriplet(userName) {
this.currentUserName = userName
this.tripletVisible = true
},
preEdit(id, userName, nickName, userWeight) { preEdit(id, userName, nickName, userWeight) {
this.form.userName = userName this.form.userName = userName
this.form.nickName = nickName this.form.nickName = nickName
...@@ -247,7 +258,7 @@ export default { ...@@ -247,7 +258,7 @@ export default {
async addUser(addType) { async addUser(addType) {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/csdn/user/add', { const { data: res } = await axios.post('http://localhost:8888/csdn/user/add', {
addType: addType, addType: addType,
userName: this.form.userName, userName: this.form.userName,
nickName: this.form.nickName, nickName: this.form.nickName,
...@@ -280,7 +291,7 @@ export default { ...@@ -280,7 +291,7 @@ export default {
async editConfirm() { async editConfirm() {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/csdn/user/update', { const { data: res } = await axios.post('http://localhost:8888/csdn/user/update', {
id: this.currentRowId, id: this.currentRowId,
userName: this.form.userName, userName: this.form.userName,
nickName: this.form.nickName, nickName: this.form.nickName,
...@@ -303,11 +314,28 @@ export default { ...@@ -303,11 +314,28 @@ export default {
this.loading = false this.loading = false
} }
}, },
async allTriplet() {
const { data: res } = await axios.get('http://localhost:8888/csdn/multiTriplet')
if (res.code === 200) {
this.userPage()
} else {
console.error('Received non-200 status code', res)
}
},
async triplet(userName) {
const { data: res } = await axios.get('http://localhost:8888/csdn/singleTriplet?' + userName)
if (res.code === 200) {
this.userPage()
this.currentUserName = null
this.tripletVisible = false
} else {
console.error('Received non-200 status code', res)
}
},
async onDelete(id) { async onDelete(id) {
this.dialogVisible = false this.dialogVisible = false
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/csdn/user/delete', { const { data: res } = await axios.get('http://localhost:8888/csdn/user/delete', {
params: { params: {
id: id, id: id,
}, },
...@@ -322,7 +350,7 @@ export default { ...@@ -322,7 +350,7 @@ export default {
}, },
async userPage() { async userPage() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/csdn/user/page', { const { data: res } = await axios.get('http://localhost:8888/csdn/user/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
......
...@@ -205,7 +205,7 @@ export default { ...@@ -205,7 +205,7 @@ export default {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/interviewQuestion/add', { const { data: res } = await axios.post('http://localhost:8888/interviewQuestion/add', {
addType: addType, addType: addType,
question: this.form.question, question: this.form.question,
questionType: this.form.questionType, questionType: this.form.questionType,
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/interviewQuestion/update', { const { data: res } = await axios.post('http://localhost:8888/interviewQuestion/update', {
id: this.currentRowId, id: this.currentRowId,
question: this.form.question, question: this.form.question,
questionType: this.form.questionType, questionType: this.form.questionType,
...@@ -262,7 +262,7 @@ export default { ...@@ -262,7 +262,7 @@ export default {
async onDelete(id) { async onDelete(id) {
this.dialogVisible = false this.dialogVisible = false
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/delete', { const { data: res } = await axios.get('http://localhost:8888/interviewQuestion/delete', {
params: { params: {
id: id, id: id,
}, },
...@@ -278,7 +278,7 @@ export default { ...@@ -278,7 +278,7 @@ export default {
}, },
async getQuestionType() { async getQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/questionType', { params: {} }) const { data: res } = await axios.get('http://localhost:8888/interviewQuestion/questionType', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.options = res.result this.options = res.result
this.interviewPage() this.interviewPage()
...@@ -287,7 +287,7 @@ export default { ...@@ -287,7 +287,7 @@ export default {
async interviewPage() { async interviewPage() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/page', { const { data: res } = await axios.get('http://localhost:8888/interviewQuestion/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
}, },
async queryPic() { async queryPic() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/picInfo/page', { const { data: res } = await axios.get('http://localhost:8888/picInfo/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
......
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
}, },
async interviewRandom() { async interviewRandom() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/random', { params: {} }) const { data: res } = await axios.get('http://localhost:8888/aphorismPoetry/random', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.randomAlgorithmic.poetryText = res.result.poetryText this.randomAlgorithmic.poetryText = res.result.poetryText
} }
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
response: this.form.response, response: this.form.response,
} }
axios axios
.post('http://120.79.36.53:8888/chatbot', data) .post('http://localhost:8888/chatbot', data)
.then((response) => { .then((response) => {
// 只要请求回来的数据,在页面渲染期间要用到,则必须转存到 data 中 // 只要请求回来的数据,在页面渲染期间要用到,则必须转存到 data 中
if (response.data.code === 200) { if (response.data.code === 200) {
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
// 封装请求列表数据的方法 // 封装请求列表数据的方法
async initChatList() { async initChatList() {
// 调用 axios 的 get 方法,请求列表数据 // 调用 axios 的 get 方法,请求列表数据
const { data: res } = await axios.get('http://120.79.36.53:8888/chatbot/' + this.id) const { data: res } = await axios.get('http://localhost:8888/chatbot/' + this.id)
// 只要请求回来的数据,在页面渲染期间要用到,则必须转存到 data 中 // 只要请求回来的数据,在页面渲染期间要用到,则必须转存到 data 中
if (res.code === 200) { if (res.code === 200) {
this.list = [ this.list = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册