2023-12-27 22:41:57 +08:00
|
|
|
|
<script setup></script>
|
2023-12-14 10:15:23 +08:00
|
|
|
|
|
|
|
|
|
|
<template>
|
2023-12-27 22:41:57 +08:00
|
|
|
|
<el-config-provider :locale="locale">
|
|
|
|
|
|
<RouterView />
|
|
|
|
|
|
</el-config-provider>
|
2023-12-14 10:15:23 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
2024-01-15 00:25:25 +08:00
|
|
|
|
import signalR from "@/utils/signalR";
|
|
|
|
|
|
import useAuths from "@/hooks/useAuths";
|
2023-12-14 10:15:23 +08:00
|
|
|
|
import useConfigStore from "@/stores/config";
|
2023-12-27 22:41:57 +08:00
|
|
|
|
import { ElConfigProvider } from "element-plus";
|
2024-01-15 00:25:25 +08:00
|
|
|
|
import { onMounted,watch } from "vue";
|
|
|
|
|
|
const { tokenValue } = useAuths();
|
2023-12-27 22:41:57 +08:00
|
|
|
|
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
|
|
|
|
|
|
const locale = zhCn;
|
2023-12-14 10:15:23 +08:00
|
|
|
|
const configStore = useConfigStore();
|
|
|
|
|
|
|
2023-12-27 22:41:57 +08:00
|
|
|
|
// 判断是否有loading有的话去掉
|
|
|
|
|
|
const loading = document.getElementById("Loading");
|
|
|
|
|
|
if (loading !== null) {
|
|
|
|
|
|
document.body.removeChild(Loading);
|
|
|
|
|
|
}
|
2023-12-14 10:15:23 +08:00
|
|
|
|
|
2023-12-27 22:41:57 +08:00
|
|
|
|
//加载全局信息
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
await configStore.getConfig();
|
2024-01-15 00:25:25 +08:00
|
|
|
|
// setInterval(() => {
|
|
|
|
|
|
// console.log("token的值:"+tokenValue.value);
|
|
|
|
|
|
// }, 1000); // 1000毫秒,即1秒
|
2023-12-27 22:41:57 +08:00
|
|
|
|
});
|
2024-01-15 00:25:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// watch(
|
|
|
|
|
|
// () => tokenValue,
|
|
|
|
|
|
// (val,oldValue) => {
|
|
|
|
|
|
// console.log("token发生改变");
|
|
|
|
|
|
// if (val) {
|
|
|
|
|
|
// signalR.close();
|
|
|
|
|
|
// signalR.init(`main`);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// },
|
|
|
|
|
|
// { deep:true }
|
|
|
|
|
|
// );
|
2023-12-14 10:15:23 +08:00
|
|
|
|
</script>
|
2023-12-27 22:41:57 +08:00
|
|
|
|
<style scoped></style>
|