Ver Fonte

更新页面逻辑

lex há 2 anos atrás
pai
commit
ef6d6052a1
2 ficheiros alterados com 10 adições e 4 exclusões
  1. 8 1
      src/router/index.ts
  2. 2 3
      src/teacher/App.vue

+ 8 - 1
src/router/index.ts

@@ -8,16 +8,23 @@ import routesManage from './routes-manage'
 
 const paymentType = (window as any).paymentType
 let routes: any = []
+let baseUrl = null as any
 if (paymentType === 'STUDENT') {
   routes = routesStudent
 } else if (paymentType === 'TEACHER') {
   routes = routesTeacher
+  baseUrl = '/teacher.html'
 } else if (paymentType === 'SCHOOL') {
   routes = routesManage
+  baseUrl = '/school.html'
+}
+
+if (location.origin.indexOf('location') <= -1 || location.origin.indexOf('192.168.3') <= -1) {
+  baseUrl = ''
 }
 
 const router: Router = createRouter({
-  history: createWebHistory(),
+  history: createWebHistory(baseUrl),
   routes,
   scrollBehavior(to, from, savedPosition) {
     if (to.hash) {

+ 2 - 3
src/teacher/App.vue

@@ -3,9 +3,8 @@
 </template>
 
 <script lang="ts">
-import { defineComponent } from 'vue';
-
+import { defineComponent } from 'vue'
 export default defineComponent({
   name: 'App'
-});
+})
 </script>