fix: BUG修改
This commit is contained in:
parent
86469738ad
commit
1eba771ad9
@ -11,7 +11,7 @@ const modules = import.meta.glob("@/views/**/*.vue");
|
||||
/**
|
||||
* 初始化动态路由
|
||||
*/
|
||||
export const initDynamicRouter = async (params?: any) => {
|
||||
export const initDynamicRouter = async (params?: any, defaultUrl?: any) => {
|
||||
const authStore = AuthStore();
|
||||
const globalStore = GlobalStore();
|
||||
try {
|
||||
@ -44,7 +44,7 @@ export const initDynamicRouter = async (params?: any) => {
|
||||
}
|
||||
if (item.meta.isFull) {
|
||||
router.addRoute(item);
|
||||
if (globalStore.path) {
|
||||
if (globalStore.path && !defaultUrl) {
|
||||
console.log("big");
|
||||
router.push(globalStore.path);
|
||||
|
||||
@ -56,14 +56,18 @@ export const initDynamicRouter = async (params?: any) => {
|
||||
router.addRoute("layout", item);
|
||||
if (globalStore.path) {
|
||||
// console.log("exec");
|
||||
if (globalStore.path == item.path) {
|
||||
if (globalStore.path == item.path && !defaultUrl) {
|
||||
router.push(globalStore.path);
|
||||
++toNum;
|
||||
} else {
|
||||
if (item.path != "/" && toNum < 1) {
|
||||
if (item.path != "/" && toNum < 1 && !defaultUrl) {
|
||||
router.push(item.path);
|
||||
++toNum;
|
||||
}
|
||||
if (item.path != "/" && toNum < 1 && defaultUrl) {
|
||||
router.push(defaultUrl);
|
||||
++toNum;
|
||||
}
|
||||
}
|
||||
// globalStore.setPath(null);
|
||||
} else {
|
||||
|
||||
@ -48,7 +48,7 @@ const tokenIdentify = async () => {
|
||||
keepAlive.setKeepAliveName();
|
||||
await sendMessage({ isSuccess: true }, 2);
|
||||
globalStore.setPath(data["惠州项目"][0].modulePath);
|
||||
await initDynamicRouter({ moduleId: data["惠州项目"][0].moduleId });
|
||||
await initDynamicRouter({ moduleId: data["惠州项目"][0].moduleId }, route.query.routeUrl);
|
||||
globalStore.moduleId = data["惠州项目"][0].moduleId;
|
||||
// if (responseData.accountType === 2) {
|
||||
// await sendMessage({ isSuccess: true }, 2);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user