Skip to content

Commit

Permalink
v0.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gotoeasy committed Jun 21, 2024
1 parent 953c23e commit 117c388
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions glc/www/web/src/api/request.axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, // 指定请求超时的毫秒数
});

Expand Down
5 changes: 2 additions & 3 deletions glc/www/web/src/components/layout/page-header/PageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const fnOpenChangePswDialog = () => {
async function logout() {
if (await $msg.confirm('确定要退出系统吗?')) {
userLogout();
router.push('/login');
router.push('/glc/login');
}
}
Expand Down Expand Up @@ -194,7 +194,7 @@ function normalizeVer(ver) {
</script>

<style lang="scss">
<style lang="scss">
div.el-popper.el-dropdown__popper.el-popper {
margin-top: -8px;
margin-left: 8px;
Expand Down Expand Up @@ -227,4 +227,3 @@ div.el-popper.el-dropdown__popper.el-popper {
}
}
</style>

6 changes: 3 additions & 3 deletions glc/www/web/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 } }); // 跳转登录页,并附带目标页参数
}
}

Expand All @@ -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 });
}
Expand Down
2 changes: 1 addition & 1 deletion glc/www/web/src/router/static.routers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const staticRouters = [
redirect: '/glc/search',
},
{
path: '/login',
path: '/glc/login',
component: () => import('~/views/login/Login.vue'), // 登录路由,必有
},
{
Expand Down
4 changes: 2 additions & 2 deletions glc/www/web/src/views/glc/search/GlcMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ onMounted(async () => {
} else if (rs.code == 403) {
userLogout(); // 403 时登出
router.push('/login');
router.push('/glc/login');
}
});
Expand Down Expand Up @@ -411,7 +411,7 @@ function search() {
} else if (rs.code == 403) {
userLogout(); // 403 时登出
router.push('/login');
router.push('/glc/login');
}
}).finally(() => {
showTableLoadding.value = false;
Expand Down
4 changes: 2 additions & 2 deletions glc/www/web/src/views/glc/storages/StoragesMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit 117c388

Please sign in to comment.