diff --git a/glc/www/web/src/api/request.axios.js b/glc/www/web/src/api/request.axios.js index 6eb7d98..bf763eb 100644 --- a/glc/www/web/src/api/request.axios.js +++ b/glc/www/web/src/api/request.axios.js @@ -4,13 +4,13 @@ import { $msg, $emitter, useTokenStore } from '~/pkgs'; import { mockUrls } from '~/config/mock-urls.config'; let tokenStore = null; -const { VITE_AXIOS_BASE_URL, VITE_DEV_DOMAIN_URL, VITE_API_DOMAIN_PATH, VITE_DEV_MOCK } = import.meta.env; +const { VITE_DEV_DOMAIN_URL, VITE_API_DOMAIN_PATH, VITE_DEV_MOCK } = import.meta.env; const msgSet = new Set(); // 创建请求实例 const axiosInstance = axios.create({ - baseURL: VITE_AXIOS_BASE_URL, + baseURL: VITE_API_DOMAIN_PATH, timeout: config.TIMEOUT, // 指定请求超时的毫秒数 }); diff --git a/glc/www/web/src/components/layout/page-header/PageHeader.vue b/glc/www/web/src/components/layout/page-header/PageHeader.vue index 1de73e0..42ba5b1 100644 --- a/glc/www/web/src/components/layout/page-header/PageHeader.vue +++ b/glc/www/web/src/components/layout/page-header/PageHeader.vue @@ -163,7 +163,7 @@ const fnOpenChangePswDialog = () => { async function logout() { if (await $msg.confirm('确定要退出系统吗?')) { userLogout(); - router.push('/login'); + router.push('/glc/login'); } } @@ -194,7 +194,7 @@ function normalizeVer(ver) { - - diff --git a/glc/www/web/src/router/index.js b/glc/www/web/src/router/index.js index 2ced4cc..f1d5519 100644 --- a/glc/www/web/src/router/index.js +++ b/glc/www/web/src/router/index.js @@ -6,7 +6,7 @@ import { enableLogin } from '~/api'; import { staticRouters } from './static.routers'; // 白名单 -const WHITE_LIST = ['/login']; +const WHITE_LIST = ['/glc/login']; // 此处不能初始化,否则无法持久化 let tabsState = null; @@ -43,7 +43,7 @@ router.beforeEach(async (to, from, next) => { if (tokenStore.needLogin == 'true') { if (!tokenStore.token) { const redirect = encodeURIComponent(to.fullPath); - return next({ path: '/login', query: { redirect } }); // 跳转登录页,并附带目标页参数 + return next({ path: '/glc/login', query: { redirect } }); // 跳转登录页,并附带目标页参数 } } @@ -53,7 +53,7 @@ router.beforeEach(async (to, from, next) => { await initRouters(); } catch (e) { tokenStore.$reset(); - return next({ path: '/login' }); // 系统打开连菜单数据都取不到,多数是服务器停止之类,无法继续,清空登录令牌后跳转停留到登录页面 + return next({ path: '/glc/login' }); // 系统打开连菜单数据都取不到,多数是服务器停止之类,无法继续,清空登录令牌后跳转停留到登录页面 } return next({ ...to, replace: true }); } diff --git a/glc/www/web/src/router/static.routers.js b/glc/www/web/src/router/static.routers.js index d32b59b..e592714 100644 --- a/glc/www/web/src/router/static.routers.js +++ b/glc/www/web/src/router/static.routers.js @@ -16,7 +16,7 @@ export const staticRouters = [ redirect: '/glc/search', }, { - path: '/login', + path: '/glc/login', component: () => import('~/views/login/Login.vue'), // 登录路由,必有 }, { diff --git a/glc/www/web/src/views/glc/search/GlcMain.vue b/glc/www/web/src/views/glc/search/GlcMain.vue index 68e8035..8ef7068 100644 --- a/glc/www/web/src/views/glc/search/GlcMain.vue +++ b/glc/www/web/src/views/glc/search/GlcMain.vue @@ -268,7 +268,7 @@ onMounted(async () => { } else if (rs.code == 403) { userLogout(); // 403 时登出 - router.push('/login'); + router.push('/glc/login'); } }); @@ -411,7 +411,7 @@ function search() { } else if (rs.code == 403) { userLogout(); // 403 时登出 - router.push('/login'); + router.push('/glc/login'); } }).finally(() => { showTableLoadding.value = false; diff --git a/glc/www/web/src/views/glc/storages/StoragesMain.vue b/glc/www/web/src/views/glc/storages/StoragesMain.vue index eb50f6d..0136d85 100644 --- a/glc/www/web/src/views/glc/storages/StoragesMain.vue +++ b/glc/www/web/src/views/glc/storages/StoragesMain.vue @@ -79,7 +79,7 @@ function search() { document.querySelector('.c-glc-table .el-scrollbar__wrap').scrollTop = 0; // 滚动到顶部 } else if (rs.code == 403) { userLogout(); // 403 时登出 - router.push('/login'); + router.push('/glc/login'); } }).finally(() => { showTableLoadding.value = false; @@ -97,7 +97,7 @@ async function remove(row) { search(); } else if (rs.code == 403) { userLogout(); // 403 时登出 - router.push('/login'); + router.push('/glc/login'); } else { $msg.error(rs.message); }