Просмотр исходного кода

练习题 选择题完善功能

dusenyao 1 год назад
Родитель
Сommit
6a89014d22
2 измененных файлов с 15 добавлено и 3 удалено
  1. 13 1
      src/App.vue
  2. 2 2
      src/router/modules/index.js

+ 13 - 1
src/App.vue

@@ -5,6 +5,8 @@
 </template>
 
 <script>
+import { getConfig } from '@/utils/auth';
+
 export default {
   name: 'App',
   created() {
@@ -28,6 +30,16 @@ export default {
       // 处理 Promise 拒绝错误
       // console.error('未捕获的 Promise.reject 错误:', reason);
     });
-  }
+
+    const config = getConfig();
+    if (config) {
+      const link = document.querySelector("link[rel*='icon']") || document.createElement('link');
+      link.type = 'image/x-icon';
+      link.rel = 'shortcut icon';
+      link.href = config.title_icon_url;
+      document.getElementsByTagName('head')[0].appendChild(link);
+    }
+  },
+  methods: {}
 };
 </script>

+ 2 - 2
src/router/modules/index.js

@@ -1,4 +1,4 @@
-import { LoginPage, HomePage, NotFoundPage } from './basic';
+import { LoginPage, HomePage, NotFoundPage, EnterSys } from './basic';
 import ExerciseRouters from './exercise';
 
-export const routes = [LoginPage, HomePage, ...ExerciseRouters, NotFoundPage];
+export const routes = [LoginPage, EnterSys, HomePage, ...ExerciseRouters, NotFoundPage];