fix: BUG修改

This commit is contained in:
kun 2023-10-30 18:21:38 +08:00
parent 7710cb4b10
commit e87e824a03

View File

@ -58,7 +58,8 @@ router.beforeEach(async (to, from, next) => {
// 4.判断访问页面是否在路由白名单地址中,如果存在直接放行 // 4.判断访问页面是否在路由白名单地址中,如果存在直接放行
if (ROUTER_WHITE_LIST.includes(to.path)) { if (ROUTER_WHITE_LIST.includes(to.path)) {
if (to.query.token) { console.log(to);
if (to.query.token && to.path != "/load") {
// 有第三方token时需要先请求一下菜单 // 有第三方token时需要先请求一下菜单
const res = await userAnalysis({ const res = await userAnalysis({
ssoToken: to.query.token ssoToken: to.query.token
@ -79,12 +80,13 @@ router.beforeEach(async (to, from, next) => {
// keepAlive.setKeepAliveName(); // keepAlive.setKeepAliveName();
// await sendMessage({ isSuccess: true }, 2); // await sendMessage({ isSuccess: true }, 2);
globalStore.setPath(to.path); globalStore.setPath(to.path);
await initDynamicRouter(); await initDynamicRouter({ moduleId: data["惠州项目"][0].moduleId });
return next(); globalStore.moduleId = data["惠州项目"][0].moduleId;
// globalStore.moduleId = data["惠州项目"][0].moduleId; // globalStore.moduleId = data["惠州项目"][0].moduleId;
} }
} else {
return next();
} }
return next();
} }
// 5.判断是否有 Token没有重定向到 login // 5.判断是否有 Token没有重定向到 login