fix: 路由调整
This commit is contained in:
@@ -32,7 +32,7 @@ export function createPermissionGuard(router: Router, whiteNameList: string[]) {
|
||||
to.name &&
|
||||
!whiteNameList.includes(to.name as string)
|
||||
) {
|
||||
NsMessage.error('登陆信息已过期,请重新登录!', 1);
|
||||
NsMessage.error('登录信息已过期,请重新登录!', 1);
|
||||
next({ name: 'login' });
|
||||
} else {
|
||||
// 存储用户信息
|
||||
|
@@ -78,7 +78,7 @@ export class NSAxios {
|
||||
const errCodeMap = new Map([
|
||||
[13, ''],
|
||||
[1, ''],
|
||||
[3005, JSON.stringify(() => routerConfig.logout())],
|
||||
[3005, () => routerConfig.logout()],
|
||||
]);
|
||||
|
||||
// type closeType = (() => void) | undefined;
|
||||
@@ -88,10 +88,12 @@ export class NSAxios {
|
||||
const code = res?.data?.retcode;
|
||||
const msg = res?.data?.msg;
|
||||
if (errCodeMap.has(code)) {
|
||||
console.log(errCodeMap.get(code));
|
||||
|
||||
NsMessage.error({
|
||||
content: msg,
|
||||
key: this.errorMsgKey,
|
||||
onClose: errCodeMap.get(code) && JSON.parse(errCodeMap.get(code)!)(),
|
||||
onClose: errCodeMap.get(code) && errCodeMap.get(code)(),
|
||||
});
|
||||
return Promise.reject(res);
|
||||
}
|
||||
|
Reference in New Issue
Block a user