fix: BUG修改

This commit is contained in:
kun 2023-08-03 09:40:56 +08:00
parent 8174db0433
commit a7a4ceddf4

View File

@ -13,6 +13,7 @@ import { GlobalStore } from "@/stores";
import { TabsStore } from "@/stores/modules/tabs"; import { TabsStore } from "@/stores/modules/tabs";
import { KeepAliveStore } from "@/stores/modules/keepAlive"; import { KeepAliveStore } from "@/stores/modules/keepAlive";
import { initDynamicRouter } from "@/routers/modules/dynamicRouter"; import { initDynamicRouter } from "@/routers/modules/dynamicRouter";
import { getHomePage } from "@/api/modules/goverment";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const globalStore = GlobalStore(); const globalStore = GlobalStore();
@ -39,22 +40,26 @@ const tokenIdentify = async () => {
// await initDynamicRouter(); // await initDynamicRouter();
// router.push(arr[result.accountType - 1]); // router.push(arr[result.accountType - 1]);
// 3. tabskeepAlive // 3. tabskeepAlive
// module
const res1 = await getHomePage();
let data = {};
data = res1.result || {};
tabsStore.closeMultipleTab(); tabsStore.closeMultipleTab();
keepAlive.setKeepAliveName(); keepAlive.setKeepAliveName();
await sendMessage({ isSuccess: true }, 2); await sendMessage({ isSuccess: true }, 2);
globalStore.setPath("/goverment/huizhou/largeScreen/largeScreenOne/index"); globalStore.setPath(data["惠州项目"][0].modulePath);
await initDynamicRouter({ moduleId: "1670639811581595650" }); await initDynamicRouter({ moduleId: data["惠州项目"][0].moduleId });
globalStore.moduleId = "1670639811581595650"; globalStore.moduleId = data["惠州项目"][0].moduleId;
// if (responseData.accountType === 2) { // if (responseData.accountType === 2) {
// await sendMessage({ isSuccess: true }, 2); // await sendMessage({ isSuccess: true }, 2);
// globalStore.setPath("/goverment/huizhou/largeScreen/largeScreenOne/index"); // globalStore.setPath("/goverment/huizhou/largeScreen/largeScreenOne/index");
// await initDynamicRouter({ moduleId: "1670639811581595650" }); // await initDynamicRouter({ moduleId: "1670639811581595650" });
// globalStore.moduleId = "1670639811581595650"; // globalStore.moduleId = "1670639811581595650";
// } else if (responseData.accountType == 4) { // } else if (responseData.accountType == 3) {
// await sendMessage({ isSuccess: true }, 2); // await sendMessage({ isSuccess: true }, 2);
// globalStore.setPath("/hz-project/largeScreen/largeScreenOne/index"); // globalStore.setPath("/goverment/huizhou/projectList/index");
// await initDynamicRouter({ moduleId: "1670603312504918018" }); // await initDynamicRouter({ moduleId: "1681837103227502594" });
// globalStore.moduleId = "1670603312504918018"; // globalStore.moduleId = "1681837103227502594";
// } // }
} else { } else {
// ElMessage.error(""); // ElMessage.error("");