用户界面

This commit is contained in:
橙子
2021-10-20 16:38:39 +08:00
parent 7f5cba11b7
commit 1bf37a2590
11 changed files with 244 additions and 168 deletions

View File

@@ -49,14 +49,33 @@ myaxios.interceptors.response.use(async function(response) {
store.dispatch("closeLoad");
return resp;
}, function(error) {
}, async function(error) {
const resp = error.response.data
if (resp.code == undefined && resp.msg == undefined) {
vm.$dialog.notify.error("错误代码:无,原因:与服务器失去连接", {
position: "top-right",
timeout: 5000,
});
} else if (resp.code == 401) {
const res = await vm.$dialog.error({
text: `错误代码:${resp.code},原因:${resp.msg}<br>是否重新进行登录?`,
title: '错误',
actions: {
'false': '取消',
'true': '跳转'
}
});
if (res) {
vm.$store.dispatch("Logout").then((resp) => {
vm.$router.push({ path: "/login" });
});
}
} else if (resp.code !== 200) {
vm.$dialog.notify.error(`错误代码:${resp.code},原因:${resp.msg}`, {
position: "top-right",
timeout: 5000,
});
}
store.dispatch("closeLoad");