整理

上级 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">
...@@ -112,268 +117,291 @@ ...@@ -112,268 +117,291 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'MyCsdnUser', name: 'MyCsdnUser',
data() {
return {
form: {
userName: '',
nickName: '',
userWeight: 0,
},
formInline: {
userName: '',
nickName: '',
},
allOptions: [
{
type: 9,
name: '铁子',
},
{ type: 8, name: '闺蜜' },
{ type: 7, name: '基友' },
{ type: 0, name: '默认' },
],
likeStatus: [
{
type: 0,
name: '未处理',
},
{ type: 1, name: '已经点过赞' },
{ type: 2, name: '点赞已满' },
{ type: 3, name: '取消点赞' },
{ type: 9, name: '点赞成功' },
],
collectStatus: [
{
type: 0,
name: '未处理',
},
{ type: 1, name: '已经收藏过' },
{ type: 2, name: '收藏已满' },
{ type: 3, name: '参数缺失' },
{ type: 9, name: '收藏成功' },
],
commentStatus: [
{
type: 0,
name: '未处理',
},
{ type: 1, name: '已经评论过' },
{ type: 2, name: '评论已满' },
{ type: 3, name: '禁言' },
{ type: 4, name: '评论太快' },
{ type: 5, name: '评论已经到了49条' },
{ type: 8, name: '其他错误' },
{ type: 9, name: '收藏成功' },
],
dialogFormVisible: false,
dialogMutiFormVisible: false,
dialogVisible: false,
editVisible: false,
// 用户列表数据
csdnUserList: [],
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnUserPage')) || 1,
pageSize: 9,
total: 0,
// 新增的内容
formLabelWidth: '120px',
currentRowId: null,
}
},
watch: {
'formInline.userName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
'formInline.nickName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
localStorage.setItem('csdnUserPage', newPage.toString())
},
},
created() {
//获取问题类型的枚举
this.userPage()
},
mounted() {
this.currentPage = 1
},
methods: {
prepareAdd() {
this.form.userName = ''
this.form.nickName = ''
this.dialogFormVisible = true
},
prepareMutiAdd() {
this.form.userName = ''
this.dialogMutiFormVisible = true
},
prepareDelete(id) {
this.currentRowId = id
this.dialogVisible = true
},
preEdit(id, userName, nickName, userWeight) {
this.form.userName = userName
this.form.nickName = nickName
this.form.userWeight = userWeight
this.currentRowId = id
this.editVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false
this.addUser(addType) // 发送请求
},
async addUser(addType) { data() {
try { return {
this.loading = true form: {
const { data: res } = await axios.post('http://120.79.36.53:8888/csdn/user/add', { userName: '',
addType: addType, nickName: '',
userName: this.form.userName, userWeight: 0,
nickName: this.form.nickName, },
userWeight: this.form.userWeight, formInline: {
}) userName: '',
if (res.code === 200) { nickName: '',
this.currentPage = 1 },
this.form.userName = '' allOptions: [
this.form.nickName = '' {
this.form.userWeight = 0 type: 9,
this.userPage() name: '铁子',
} else { },
console.error('Received non-200 status code', res) { type: 8, name: '闺蜜' },
this.errorMsg(res.message) { type: 7, name: '基友' },
} { type: 0, name: '默认' },
} catch (error) { ],
console.error('An error occurred while adding the questionName:', error) likeStatus: [
// 异常处理逻辑 {
} finally { type: 0,
this.loading = false name: '未处理',
} },
}, { type: 1, name: '已经点过赞' },
errorMsg(msg) { { type: 2, name: '点赞已满' },
this.$message({ { type: 3, name: '取消点赞' },
showClose: true, { type: 9, name: '点赞成功' },
message: msg, ],
type: 'error', collectStatus: [
}) {
}, type: 0,
async editConfirm() { name: '未处理',
try { },
this.loading = true { type: 1, name: '已经收藏过' },
const { data: res } = await axios.post('http://120.79.36.53:8888/csdn/user/update', { { type: 2, name: '收藏已满' },
id: this.currentRowId, { type: 3, name: '参数缺失' },
userName: this.form.userName, { type: 9, name: '收藏成功' },
nickName: this.form.nickName, ],
userWeight: this.form.userWeight, commentStatus: [
}) {
if (res.code === 200) { type: 0,
this.form.userName = '' name: '未处理',
this.form.nickName = '' },
this.form.userWeight = 0 { type: 1, name: '已经评论过' },
this.editVisible = false { type: 2, name: '评论已满' },
currentRowId: null { type: 3, name: '禁言' },
this.userPage() { type: 4, name: '评论太快' },
} else { { type: 5, name: '评论已经到了49条' },
console.error('Received non-200 status code', res) { type: 8, name: '其他错误' },
} { type: 9, name: '收藏成功' },
} catch (error) { ],
console.error('An error occurred while adding the questionName:', error) dialogFormVisible: false,
// 异常处理逻辑 dialogMutiFormVisible: false,
} finally { dialogVisible: false,
this.loading = false editVisible: false,
} tripletVisible: false,
}, // 用户列表数据
csdnUserList: [],
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnUserPage')) || 1,
pageSize: 9,
total: 0,
// 新增的内容
formLabelWidth: '120px',
currentRowId: null,
currentUserName: null,
}
},
watch: {
'formInline.userName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
'formInline.nickName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
localStorage.setItem('csdnUserPage', newPage.toString())
},
},
created() {
//获取问题类型的枚举
this.userPage()
},
mounted() {
this.currentPage = 1
},
methods: {
prepareAdd() {
this.form.userName = ''
this.form.nickName = ''
this.dialogFormVisible = true
},
prepareMutiAdd() {
this.form.userName = ''
this.dialogMutiFormVisible = true
},
prepareDelete(id) {
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
this.form.userWeight = userWeight
this.currentRowId = id
this.editVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false
this.addUser(addType) // 发送请求
},
async onDelete(id) { async addUser(addType) {
this.dialogVisible = false try {
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.post('http://localhost:8888/csdn/user/add', {
params: { addType: addType,
id: id, userName: this.form.userName,
}, nickName: this.form.nickName,
}) userWeight: this.form.userWeight,
this.userPage() })
this.loading = false if (res.code === 200) {
}, this.currentPage = 1
refreshPage() { this.form.userName = ''
//获取问题类型的枚举 this.form.nickName = ''
this.userPage() this.form.userWeight = 0
location.reload() this.userPage()
}, } else {
async userPage() { console.error('Received non-200 status code', res)
this.loading = true this.errorMsg(res.message)
const { data: res } = await axios.get('http://120.79.36.53:8888/csdn/user/page', { }
params: { } catch (error) {
page: this.currentPage, console.error('An error occurred while adding the questionName:', error)
pageSize: this.pageSize, // 异常处理逻辑
userName: this.formInline.userName, } finally {
nickName: this.formInline.nickName, this.loading = false
}, }
}) },
if (res.code === 200) { errorMsg(msg) {
this.total = res.result.totalElements this.$message({
showClose: true,
message: msg,
type: 'error',
})
},
async editConfirm() {
try {
this.loading = true
const { data: res } = await axios.post('http://localhost:8888/csdn/user/update', {
id: this.currentRowId,
userName: this.form.userName,
nickName: this.form.nickName,
userWeight: this.form.userWeight,
})
if (res.code === 200) {
this.form.userName = ''
this.form.nickName = ''
this.form.userWeight = 0
this.editVisible = false
currentRowId: null
this.userPage()
} else {
console.error('Received non-200 status code', res)
}
} catch (error) {
console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑
} finally {
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://localhost:8888/csdn/user/delete', {
params: {
id: id,
},
})
this.userPage()
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.userPage()
location.reload()
},
async userPage() {
this.loading = true
const { data: res } = await axios.get('http://localhost:8888/csdn/user/page', {
params: {
page: this.currentPage,
pageSize: this.pageSize,
userName: this.formInline.userName,
nickName: this.formInline.nickName,
},
})
if (res.code === 200) {
this.total = res.result.totalElements
const userWeightMap = {} const userWeightMap = {}
this.allOptions.forEach((option) => { this.allOptions.forEach((option) => {
userWeightMap[option.type] = option.name userWeightMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.userWeightName = userWeightMap[item.userWeight] item.userWeightName = userWeightMap[item.userWeight]
}) })
const likeStatusMap = {} const likeStatusMap = {}
this.likeStatus.forEach((option) => { this.likeStatus.forEach((option) => {
likeStatusMap[option.type] = option.name likeStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.likeStatusName = likeStatusMap[item.likeStatus] item.likeStatusName = likeStatusMap[item.likeStatus]
}) })
const collectStatusMap = {} const collectStatusMap = {}
this.collectStatus.forEach((option) => { this.collectStatus.forEach((option) => {
collectStatusMap[option.type] = option.name collectStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.collectStatusName = collectStatusMap[item.collectStatus] item.collectStatusName = collectStatusMap[item.collectStatus]
}) })
const commentStatusMap = {} const commentStatusMap = {}
this.commentStatus.forEach((option) => { this.commentStatus.forEach((option) => {
commentStatusMap[option.type] = option.name commentStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.commentStatusName = commentStatusMap[item.commentStatus] item.commentStatusName = commentStatusMap[item.commentStatus]
}) })
this.csdnUserList = res.result.content this.csdnUserList = res.result.content
} }
this.loading = false this.loading = false
}, },
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.userPage() this.userPage()
}, },
}, },
} }
</script> </script>
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册