diff --git a/.env.development b/.env.development index 600aee7..685ac44 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,6 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV = 'development' VITE_APP_TITLE = '无糖运营平台' -VITE_APP_BASE_API = 'http://127.0.0.1:8080' -# VITE_APP_BASE_API = 'http://39.106.16.162:8080' +# VITE_APP_BASE_API = 'http://127.0.0.1:8080' +VITE_APP_BASE_API = 'http://39.106.16.162:8080' +http://localhost:5173/#/courseResourcesManagement/courseResources \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 48f07ba..e5f6be4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -14,7 +14,7 @@ const routerList = [ ] const router = createRouter({ history: createWebHashHistory(), - routes: [...routerList, ...constantRoute], + routes: [...routerList], scrollBehavior() { return { left: 0, diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2f5d534..d64bbfe 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -13,6 +13,7 @@ import { GET_TKOEN, SET_TKOEN, REMOVE_TOKEN } from '@/utils/token' // 引入常量路由 import { constantRoute } from '@/router/routers' import permissionStore from './permission' +import {useRouter} from 'vue-router' // 引入路由 import { userLoginService, @@ -145,6 +146,9 @@ const useUserStore = defineStore( this.routes = '' usePermissionStore.removeRouter() location.reload() + const router = useRouter() + console.log(router.getRoutes()); + }, }, getters: {},