فهرست منبع

关闭路由hash模式,改用history

wyling 3 سال پیش
والد
کامیت
0852836dbb
1فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 4 4
      src/route/index.ts

+ 4 - 4
src/route/index.ts

@@ -1,4 +1,4 @@
-import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
+import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";
 
 // 导入library文件夹下的所有组件
 // 批量导入需要使用一个函数 require.context(dir,deep,matching)
@@ -56,12 +56,12 @@ console.log(aotuRoutesFind("initMockTest-default"));
 
 // 创建路由实例并传递 `routes` 配置
 const router = createRouter({
-  history: createWebHashHistory(),
+  history: createWebHistory(),
   routes: [
     {
       path: "/",
-      // redirect: "/login",
-      component:()=>import('@/views/login/index.vue')
+      redirect: "/login",
+      // component:()=>import('@/views/login/index.vue')
     },
     ...aotuRoutes,
   ],