Sfoglia il codice sorgente

修改头部请求接口为取缓存

秦鹏 3 anni fa
parent
commit
2a4dc627ee
1 ha cambiato i file con 6 aggiunte e 7 eliminazioni
  1. 6 7
      src/components/Header.vue

+ 6 - 7
src/components/Header.vue

@@ -8,7 +8,6 @@
         alt=""
       />
       <span class="logo-img" v-else>logo</span>
-
       <el-menu
         :default-active="activeIndex"
         class="el-menu-demo"
@@ -133,7 +132,7 @@ import { getToken, removeToken } from "@/utils/auth";
 import Cookies from "js-cookie";
 import { getContent, getStaticContent, getLearnWebContent } from "@/api/api";
 import { setI18nLang } from "@/utils/i18n";
-import { getConfigInfor } from "@/utils/index";
+import { getConfig } from "@/utils/auth";
 
 export default {
   name: "LayoutHeader",
@@ -405,9 +404,9 @@ export default {
         this.is_exist = res.is_exist;
       });
     },
-    async _getConfig() {
-      this.configInfor = await getConfigInfor();
-    },
+    // async _getConfig() {
+    //   this.configInfor = await getConfigInfor();
+    // },
   },
   created() {},
   mounted() {
@@ -427,8 +426,8 @@ export default {
         }
       });
     }
-    _this._getConfig();
-
+    // _this._getConfig();
+    _this.configInfor = JSON.parse(getConfig());
     _this.getLangList();
     _this.headTimer = _this.getNotReadMessage();
     setInterval(() => {