update dialog

This commit is contained in:
g7hoo 2022-08-11 14:28:06 +08:00
parent a1056abe80
commit cd9beb120a
2 changed files with 26 additions and 21 deletions

View File

@ -152,7 +152,7 @@ export default {
isDetail: false,
isUpdated: false,
dataForm: {},
dataFormRules: {},
dataFormRules: {}
}
},
computed: {
@ -307,7 +307,8 @@ export default {
url: this.$http.adornUrl(urls[btn.name]),
method: btn.name === 'save' ? 'POST' : 'PUT',
data: this.dataForm
}).then(({ data: res }) => {
})
.then(({ data: res }) => {
if (res && res.code === 0) {
this.$message({
message: btn.name === 'save' ? '添加成功!' : '更新成功!',
@ -318,8 +319,11 @@ export default {
this.visible = false
}
})
} else {
this.$message.error(res.msg)
}
}).catch(err => {
})
.catch(err => {
this.$message({
message: err,
type: 'error',

View File

@ -55,9 +55,10 @@ http.interceptors.response.use(response => {
clearLoginInfo()
router.replace({ name: 'login' })
return Promise.reject(response.data.msg)
} else if (response.data.code === 500) {
return Promise.reject(response.data.msg)
}
// else if (response.data.code === 500) {
// return Promise.reject(response.data.msg)
// }
return response
}, error => {
console.error(error)