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

更新路由createWebHashHistory变成createWebHistory HTML5 History 模式

liyanbo 4 недель назад
Родитель
Сommit
12267e7383
2 измененных файлов с 7 добавлено и 5 удалено
  1. 4 2
      .env
  2. 3 3
      src/router/index.js

+ 4 - 2
.env

@@ -3,8 +3,10 @@ VITE_APP_TITLE=人工智能通识课平台
 
 # 请求路径
 # VITE_BASE_URL='http://59.110.91.129:8088/admin-api'
-# VITE_BASE_URL='https://learn-ai.com.cn/admin-api'
-VITE_BASE_URL='http://192.168.110.8:8080/admin-api'
+# VITE_BASE_URL='http://8.140.223.94:8088/admin-api'
+ VITE_BASE_URL='https://learn-ai.com.cn/admin-api'
+# VITE_BASE_URL='https://test.learn-ai.com.cn/admin-api'
+#VITE_BASE_URL='http://192.168.110.8:8080/admin-api'
 
 # 登录是否强制租户
 VITE_APP_COMPULSORY_TENANT=false

+ 3 - 3
src/router/index.js

@@ -1,4 +1,4 @@
-import {createRouter, createWebHashHistory} from 'vue-router'
+import {createRouter, createWebHistory} from 'vue-router'
 import {CONFIG, refreshRoleRoute} from "@/utils/roleUtils.js";
 import {Message} from "@/utils/message/Message.js";
 import {refreshAllDictData} from "@/utils/dictUtils.js";
@@ -240,14 +240,14 @@ const loginToHomeMap = {
 }
 
 const router = createRouter({
-  history: createWebHashHistory(),
+  history: createWebHistory(),
   routes
 })
 
 // 导航守卫
 router.beforeEach(async (to, from, next) => {
   // 注册页面始终允许访问,不需要登录状态
-  if ( ['/register-login', '/blockly-register'].includes(to.path)) {
+  if ( ['/register-login', '/register'].includes(to.path)) {
     next()
     return
   }