提交 9e71650b authored 作者: 王鹏飞's avatar 王鹏飞

chore: 修改商务数据分析师的登录地址

上级 d8153f73
......@@ -6,3 +6,4 @@ VITE_SAAS_LEARN_URL=https://saas-learn.ezijing.com
VITE_QA_CENTER_URL=https://qa-center.ezijing.com
VITE_X_LEARNING_URL=https://x-learning.ezijing.com
VITE_EXAM_SHOW_URL=https://exam-show.ezijing.com
VITE_SWSJFXS_LOGIN_URL=https://login.ezijing.com/swsjfxs/login/index
......@@ -41,7 +41,7 @@ const defaultActive = computed(() => {
})
const logout = async () => {
await userStore.logout()
location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.origin)}`
location.href = `${appConfig.loginURL || import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.origin)}`
}
function isUrl(path: string) {
......@@ -73,12 +73,7 @@ function handleClick(path: string) {
<div class="app-header-nav">
<el-menu mode="horizontal" router :default-active="defaultActive">
<template v-for="item in menus" :key="item.path">
<el-sub-menu
:index="item.path"
:popper-offset="0"
popper-class="sub-menu-popper"
v-permission="item.tag"
v-if="item.children">
<el-sub-menu :index="item.path" :popper-offset="0" popper-class="sub-menu-popper" v-permission="item.tag" v-if="item.children">
<template #title>
{{ item.name }}
</template>
......
......@@ -57,7 +57,8 @@ const appConfigList = [
xTrainLabel: '商务数据分析理论训练',
labTrainLabel: '商务数据分析实操训练',
xExamLabel: '商务数据分析理论考试',
labExamLabel: '商务数据分析实操考试'
labExamLabel: '商务数据分析实操考试',
loginURL: import.meta.env.VITE_SWSJFXS_LOGIN_URL
}
]
......
import axios from 'axios'
import { ElMessage } from 'element-plus'
import router from '@/router'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const httpRequest = axios.create({
timeout: 60000,
......@@ -37,7 +39,7 @@ httpRequest.interceptors.response.use(
const { data } = response
// 未登录
if (data.code === 4001) {
location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
location.href = `${appConfig.loginURL || import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
return Promise.reject(data)
}
if (data.code === 1) {
......@@ -51,7 +53,7 @@ httpRequest.interceptors.response.use(
const { status, message } = error.response.data
// 未登录
if (status === 403) {
location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
location.href = `${appConfig.loginURL || import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
} else if (status === 401 || status === 402) {
// 未授权
router.push('/401')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论