2023-06-29 22:26:35 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="main">
|
|
|
|
|
<div class="bg_gif"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name="load">
|
|
|
|
|
import { onMounted } from "vue";
|
|
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
|
|
import { userAnalysis } from "@/api/modules/huizhou";
|
|
|
|
|
import { ElMessage } from "element-plus";
|
|
|
|
|
import { GlobalStore } from "@/stores";
|
|
|
|
|
import { TabsStore } from "@/stores/modules/tabs";
|
|
|
|
|
import { KeepAliveStore } from "@/stores/modules/keepAlive";
|
|
|
|
|
import { initDynamicRouter } from "@/routers/modules/dynamicRouter";
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const globalStore = GlobalStore();
|
|
|
|
|
const tabsStore = TabsStore();
|
|
|
|
|
const keepAlive = KeepAliveStore();
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
tokenIdentify();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const tokenIdentify = async () => {
|
|
|
|
|
const res = await userAnalysis({
|
|
|
|
|
ssoToken: route.query.token
|
|
|
|
|
});
|
2023-06-30 17:55:29 +08:00
|
|
|
console.log(res);
|
2023-06-29 22:26:35 +08:00
|
|
|
if (res.result) {
|
|
|
|
|
let responseData = res.result;
|
|
|
|
|
globalStore.setToken(responseData.token);
|
|
|
|
|
globalStore.setAccount(responseData.account);
|
|
|
|
|
globalStore.setAccountType(responseData.accountType);
|
|
|
|
|
globalStore.setProjectDateAuth(responseData.projectDateAuth);
|
|
|
|
|
globalStore.setIsManager(responseData.isManager); //我已知晓
|
|
|
|
|
// 2.添加动态路由
|
|
|
|
|
// await initDynamicRouter();
|
|
|
|
|
// router.push(arr[result.accountType - 1]);
|
|
|
|
|
// 3.清空 tabs、keepAlive 保留的数据
|
|
|
|
|
tabsStore.closeMultipleTab();
|
|
|
|
|
keepAlive.setKeepAliveName();
|
2023-08-02 18:05:45 +08:00
|
|
|
await sendMessage({ isSuccess: true }, 2);
|
|
|
|
|
globalStore.setPath("/goverment/huizhou/largeScreen/largeScreenOne/index");
|
|
|
|
|
await initDynamicRouter({ moduleId: "1670639811581595650" });
|
|
|
|
|
globalStore.moduleId = "1670639811581595650";
|
|
|
|
|
// if (responseData.accountType === 2) {
|
|
|
|
|
// await sendMessage({ isSuccess: true }, 2);
|
|
|
|
|
// globalStore.setPath("/goverment/huizhou/largeScreen/largeScreenOne/index");
|
|
|
|
|
// await initDynamicRouter({ moduleId: "1670639811581595650" });
|
|
|
|
|
// globalStore.moduleId = "1670639811581595650";
|
|
|
|
|
// } else if (responseData.accountType == 4) {
|
|
|
|
|
// await sendMessage({ isSuccess: true }, 2);
|
|
|
|
|
// globalStore.setPath("/hz-project/largeScreen/largeScreenOne/index");
|
|
|
|
|
// await initDynamicRouter({ moduleId: "1670603312504918018" });
|
|
|
|
|
// globalStore.moduleId = "1670603312504918018";
|
|
|
|
|
// }
|
2023-06-29 22:26:35 +08:00
|
|
|
} else {
|
2023-07-05 18:32:25 +08:00
|
|
|
// ElMessage.error("登录信息异常,请刷新或重新登录!");
|
|
|
|
|
return;
|
2023-06-29 22:26:35 +08:00
|
|
|
}
|
2023-07-10 13:33:46 +08:00
|
|
|
};
|
|
|
|
|
const sendMessage = (msg, type, iframeEle) => {
|
|
|
|
|
console.log(666);
|
|
|
|
|
if (type === 1) {
|
|
|
|
|
// 父 => 子
|
|
|
|
|
iframeEle.contentWindow.postMessage(msg, "*");
|
|
|
|
|
} else if (type === 2) {
|
|
|
|
|
// 子 => 父
|
|
|
|
|
window.parent.postMessage(msg, "*");
|
|
|
|
|
}
|
|
|
|
|
console.log(777);
|
2023-06-29 22:26:35 +08:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.main {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
background-color: #0e111f;
|
|
|
|
|
|
|
|
|
|
.bg_gif {
|
|
|
|
|
width: 30%;
|
|
|
|
|
height: 520px;
|
|
|
|
|
background: url("@/assets/images/123.gif") no-repeat;
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|