lex-xin 3 năm trước cách đây
mục cha
commit
764860177a
3 tập tin đã thay đổi với 64 bổ sung28 xóa
  1. 29 27
      src/App.vue
  2. 9 1
      src/router/index.js
  3. 26 0
      src/views/afterClassEvaluate/index.vue

+ 29 - 27
src/App.vue

@@ -16,34 +16,36 @@ import { queryTeacherInfo } from "@/api/app";
 export default {
   name: "app",
   async created() {
-    const whiteList = ["/order"];
-    const routePath = this.$route.path;
-    if(whiteList.includes(routePath)) {
-      return;
-    }
-    try {
-      let Authorization = this.getQueryVariable('Authorization') || null;
-      if(window.location.hash.indexOf("+") >= 0) {
-        Authorization = Authorization ? Authorization.split('+')[1] : null
-        Authorization = ('bearer ' + Authorization)
-      } else {
-        Authorization = decodeURI(Authorization)
-      }
-      if (Authorization && Authorization != 'null') {
-        localStorage.setItem("Authorization", Authorization);
-        localStorage.setItem("userInfo", Authorization);
-      }
-      const auth = localStorage.getItem("Authorization") || "";
-      const userInfo = localStorage.getItem("userInfo") || "";
-      if (userInfo || auth) {
-        await queryTeacherInfo().then((res) => {
-          const result = res.data || null;
-          const tenantId = result.data.tenantId || 0;
-          sessionStorage.setItem("tenantId", tenantId);
-        });
+    const whiteList = ["#/order"];
+    // const routePath = this.$route.path;
+    const locationHash = window.location.hash;
+    console.log(this.$route.path, locationHash);
+    if (locationHash.includes('#/order') == -1) {
+      console.log('true')
+      try {
+        let Authorization = this.getQueryVariable("Authorization") || null;
+        if (window.location.hash.indexOf("+") >= 0) {
+          Authorization = Authorization ? Authorization.split("+")[1] : null;
+          Authorization = "bearer " + Authorization;
+        } else {
+          Authorization = decodeURI(Authorization);
+        }
+        if (Authorization && Authorization != "null") {
+          localStorage.setItem("Authorization", Authorization);
+          localStorage.setItem("userInfo", Authorization);
+        }
+        const auth = localStorage.getItem("Authorization") || "";
+        const userInfo = localStorage.getItem("userInfo") || "";
+        if (userInfo || auth) {
+          await queryTeacherInfo().then((res) => {
+            const result = res.data || null;
+            const tenantId = result.data.tenantId || 0;
+            sessionStorage.setItem("tenantId", tenantId);
+          });
+        }
+      } catch (e) {
+        console.log(e);
       }
-    } catch(e) {
-      console.log(e)
     }
   },
   async mounted() {

+ 9 - 1
src/router/index.js

@@ -62,7 +62,15 @@ let defaultRouter = [
           descrition: '实名认证',
           weight: 0
       }
-    },
+    }, {
+      path: '/afterClassEvaluate',
+      name: 'afterClassEvaluate',
+      component: () => import(/* webpackChunkName:'afterClassEvaluate' */'@/views/afterClassEvaluate/index.vue'),
+      meta: {
+          descrition: '课后评价',
+          weight: 0
+      }
+    }
 ]
 
 defaultRouter = defaultRouter.concat(TeacherRouter)

+ 26 - 0
src/views/afterClassEvaluate/index.vue

@@ -0,0 +1,26 @@
+<template>
+  <div>
+    课后价格
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'afterClassEvaluate',
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  },
+  mounted () {
+
+  }
+}
+</script>
+
+<style lang="less" scoped>
+
+</style>