整理

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