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 authStore = AuthStore();
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
try {
|
try {
|
||||||
@ -44,7 +44,7 @@ export const initDynamicRouter = async (params?: any) => {
|
|||||||
}
|
}
|
||||||
if (item.meta.isFull) {
|
if (item.meta.isFull) {
|
||||||
router.addRoute(item);
|
router.addRoute(item);
|
||||||
if (globalStore.path) {
|
if (globalStore.path && !defaultUrl) {
|
||||||
console.log("big");
|
console.log("big");
|
||||||
router.push(globalStore.path);
|
router.push(globalStore.path);
|
||||||
|
|
||||||
@ -56,14 +56,18 @@ export const initDynamicRouter = async (params?: any) => {
|
|||||||
router.addRoute("layout", item);
|
router.addRoute("layout", item);
|
||||||
if (globalStore.path) {
|
if (globalStore.path) {
|
||||||
// console.log("exec");
|
// console.log("exec");
|
||||||
if (globalStore.path == item.path) {
|
if (globalStore.path == item.path && !defaultUrl) {
|
||||||
router.push(globalStore.path);
|
router.push(globalStore.path);
|
||||||
++toNum;
|
++toNum;
|
||||||
} else {
|
} else {
|
||||||
if (item.path != "/" && toNum < 1) {
|
if (item.path != "/" && toNum < 1 && !defaultUrl) {
|
||||||
router.push(item.path);
|
router.push(item.path);
|
||||||
++toNum;
|
++toNum;
|
||||||
}
|
}
|
||||||
|
if (item.path != "/" && toNum < 1 && defaultUrl) {
|
||||||
|
router.push(defaultUrl);
|
||||||
|
++toNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// globalStore.setPath(null);
|
// globalStore.setPath(null);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ const tokenIdentify = async () => {
|
|||||||
keepAlive.setKeepAliveName();
|
keepAlive.setKeepAliveName();
|
||||||
await sendMessage({ isSuccess: true }, 2);
|
await sendMessage({ isSuccess: true }, 2);
|
||||||
globalStore.setPath(data["惠州项目"][0].modulePath);
|
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;
|
globalStore.moduleId = data["惠州项目"][0].moduleId;
|
||||||
// if (responseData.accountType === 2) {
|
// if (responseData.accountType === 2) {
|
||||||
// await sendMessage({ isSuccess: true }, 2);
|
// await sendMessage({ isSuccess: true }, 2);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user