Merge branch 'master' into master

This commit is contained in:
good luck 2020-09-09 14:30:28 +08:00 committed by GitHub
commit 89bfc69757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ import {
requestTimeout,
successCode,
tokenName,
loginInterception,
} from "@/config/settings";
import store from "@/store";
import qs from "qs";
@ -43,7 +44,13 @@ const handleCode = (code, msg) => {
switch (code) {
case invalidCode:
Vue.prototype.$baseMessage(msg || `后端接口${code}异常`, "error");
store.dispatch("user/resetAll").catch(() => {});
store.dispatch("user/resetAccessToken").catch(() => {});
if (loginInterception) {
location.reload();
}
break;
case noRoleCode:
router.push({ path: "/401" }).catch(() => {});