This commit is contained in:
joylink_cuiweidong 2019-11-28 18:45:47 +08:00
commit adbb7c3d8d

View File

@ -3,7 +3,7 @@ import store from '@/store';
import router from './router';
import NProgress from 'nprogress';
import { admin} from './router';
import { getToken} from '@/utils/auth';
import { getToken, removeToken} from '@/utils/auth';
import { LoginParams } from '@/utils/login';
import { getSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
@ -43,12 +43,20 @@ function getRouteInfo(to) {
} else if (isDesignPage(toRoutePath)) {
loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage;
clientId = LoginParams.Design.clientId;
const current_session = getSessionStorage('project');
if (current_session && !current_session.startsWith('design')) {
removeToken();
}
} else if ( /^\/xty/.test(toRoutePath)) {
loginPath = loginXtyPage;
clientId = null;
} else {
loginPath = getSessionStorage('project') === 'xty' ? loginXtyPage : loginPage;
clientId = null;
const current_session = getSessionStorage('project');
if (current_session && current_session.startsWith('design')) {
removeToken();
}
}
return { clientId, loginPath };