Merge pull request #156 from linhaojun857/dev

Fix notify
master
linhaojun857 2 years ago committed by GitHub
commit f3bee7fd69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,6 +8,9 @@ axios.interceptors.request.use((config: any) => {
axios.interceptors.response.use(
(response) => {
if (response.data.flag) {
return response
}
switch (response.data.code) {
case 50000:
app.config.globalProperties.$notify({
@ -23,6 +26,12 @@ axios.interceptors.response.use(
type: 'error'
})
break
default:
app.config.globalProperties.$notify({
title: 'Error',
message: response.data.message,
type: 'error'
})
}
return response
},

@ -85,12 +85,6 @@ export default defineComponent({
})
}
reactiveData.commentContent = ''
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}

@ -97,12 +97,6 @@ export default defineComponent({
})
}
reactiveData.commentContent = ''
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}

@ -195,12 +195,6 @@ export default defineComponent({
type: 'success'
})
reactiveDate.loginDialogVisible = false
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -216,12 +210,6 @@ export default defineComponent({
message: '登出成功',
type: 'success'
})
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -254,12 +242,6 @@ export default defineComponent({
message: '验证码已发送',
type: 'success'
})
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -278,12 +260,6 @@ export default defineComponent({
})
reactiveDate.registerDialogVisible = false
reactiveDate.loginDialogVisible = true
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -320,12 +296,6 @@ export default defineComponent({
})
reactiveDate.forgetPasswordDialogVisible = false
reactiveDate.loginDialogVisible = true
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -348,12 +318,6 @@ export default defineComponent({
reactiveDate.articlePasswordDialogVisible = false
userStore.accessArticles.push(reactiveDate.articleId)
router.push({ path: '/articles/' + reactiveDate.articleId })
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}

@ -41,12 +41,6 @@ export default defineComponent({
message: '登录成功',
type: 'success'
})
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
if (userStore.currentUrl === '') {

@ -118,12 +118,6 @@ export default defineComponent({
})
userStore.userInfo.email = reactiveData.email
reactiveData.emailDialogVisible = false
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -136,12 +130,6 @@ export default defineComponent({
message: '上传成功',
type: 'success'
})
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -158,12 +146,6 @@ export default defineComponent({
message: '修改成功',
type: 'success'
})
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -181,12 +163,6 @@ export default defineComponent({
message: '修改成功',
type: 'success'
})
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}
@ -198,12 +174,6 @@ export default defineComponent({
message: '验证码已发送',
type: 'success'
})
} else {
proxy.$notify({
title: 'Error',
message: data.message,
type: 'error'
})
}
})
}

Loading…
Cancel
Save