|
|
@@ -1,30 +1,28 @@
|
|
|
<template>
|
|
|
- <div class="app-container dark-theme "
|
|
|
- @contextmenu.prevent>
|
|
|
- <!-- 中文配置 -->
|
|
|
- <a-config-provider :locale="zhCN">
|
|
|
- <a-spin :tip="tip"
|
|
|
- :spinning="spinning"
|
|
|
- size="large">
|
|
|
- <router-view />
|
|
|
- </a-spin>
|
|
|
- </a-config-provider>
|
|
|
- </div>
|
|
|
+ <div class="app-container dark-theme" @contextmenu.prevent>
|
|
|
+ <!-- 中文配置 -->
|
|
|
+ <a-config-provider :locale="zhCN">
|
|
|
+ <a-spin :tip="tip" :spinning="spinning" size="large">
|
|
|
+ <router-view />
|
|
|
+ </a-spin>
|
|
|
+ </a-config-provider>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref, watchEffect, provide } from 'vue';
|
|
|
+import { initTheme } from '@/common/config/theme';
|
|
|
+import { setLoadComplete } from '@/common/methods';
|
|
|
+import Router from '@/router';
|
|
|
+import APP from '@/services';
|
|
|
import { globalDataRefresh } from '@/services/bus/index';
|
|
|
+import { isLogin, logout } from '@/services/bus/login';
|
|
|
import { notice } from '@/services/bus/system';
|
|
|
+import { getAppConfig } from '@/services/go/config';
|
|
|
import eventBus from '@/utils/eventBus/index';
|
|
|
import TimerUtils from '@/utils/timer/timerUtil';
|
|
|
-import Router from '@/router';
|
|
|
-import APP from '@/services';
|
|
|
import { Modal } from 'ant-design-vue';
|
|
|
-import { setLoadComplete } from '@/common/methods';
|
|
|
-import { isLogin, logout } from '@/services/bus/login';
|
|
|
import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
|
|
-import { initTheme } from '@/common/config/theme';
|
|
|
+import { defineComponent, onMounted, provide, ref, watchEffect } from 'vue';
|
|
|
let lastTime = new Date().getTime();
|
|
|
|
|
|
function logoutAction() {
|
|
|
@@ -62,6 +60,20 @@ function setOvertime() {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+// 设置 ico
|
|
|
+async function setIcon() {
|
|
|
+ const link: any = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
|
|
+ const obj = {
|
|
|
+ type: 'image/x-icon',
|
|
|
+ rel: 'shortcut icon',
|
|
|
+ href: './favicon.ico',
|
|
|
+ }
|
|
|
+ Object.assign(link, obj)
|
|
|
+ const config = await getAppConfig();
|
|
|
+ document.title = config.data.icoTitle
|
|
|
+ document.getElementsByTagName('head')[0].appendChild(link);
|
|
|
+}
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
name: 'app',
|
|
|
components: {},
|
|
|
@@ -82,6 +94,9 @@ export default defineComponent({
|
|
|
'logoutTimer'
|
|
|
);
|
|
|
});
|
|
|
+ onMounted(() => {
|
|
|
+ setIcon();
|
|
|
+ });
|
|
|
// 登录成功
|
|
|
// eventBus.$onOnly('loginSuccess', setOvertime);
|
|
|
// 监听路由的变化
|