natasha 2 years ago
parent
commit
899a1ca9c9
2 changed files with 9 additions and 1 deletions
  1. 1 1
      src/utils/get-page-title.js
  2. 8 0
      src/views/BookView2.vue

+ 1 - 1
src/utils/get-page-title.js

@@ -1,6 +1,6 @@
 import defaultSettings from '@/settings'
 
-const title = defaultSettings.title || 'BLCUP外语智慧教学平台'
+const title = defaultSettings.title || '全球国际中文教学服务云平台'
 
 export default function getPageTitle(pageTitle) {
     if (pageTitle) {

+ 8 - 0
src/views/BookView2.vue

@@ -20,6 +20,8 @@
 //例如:import 《组件名称》from ‘《组件路径》';
 import { getStaticContent } from "@/api/ajax";
 import { setToken, removeToken } from "@/utils/auth";
+import { getConfigInfor } from "@/utils/index";
+import getPageTitle from '@/utils/get-page-title'
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -53,6 +55,7 @@ export default {
         id: "002-20211011-10-GOLXUZST4G",
       },
       loading: null,
+      configInfor: null
     };
   },
   //计算属性 类似于data概念
@@ -100,9 +103,14 @@ export default {
         });
       });
     },
+    async _getConfig() {
+      this.configInfor = await getConfigInfor();
+      document.title = getPageTitle()
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
+    this._getConfig();
     this.loading = this.$loading({
       lock: true,
       text: "跳转中",