提交 31bcf603 authored 作者: haodaking's avatar haodaking

bug fixes

上级 685cf0e8
VITE_BASE_URL=https://learn-api.ezijing.com VITE_BASE_URL=https://learn-api.ezijing.com
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_X_TRAINING_URL=https://x-training.ezijing.com
VITE_BASE_URL=https://learn-api.ezijing.com VITE_BASE_URL=https://learn-api.ezijing.com
VITE_LOGIN_URL=https://login.ezijing.com/xlearn/login/index VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_X_TRAINING_URL=https://x-training.ezijing.com
VITE_BASE_URL=https://learn-api2.ezijing.com VITE_BASE_URL=https://learn-api2.ezijing.com
VITE_LOGIN_URL=https://login2.ezijing.com/xlearn/login/index VITE_LOGIN_URL=https://login2.ezijing.com/auth/login/index
VITE_X_TRAINING_URL=https://x-training2.ezijing.com
...@@ -40,4 +40,4 @@ function generateUploadTarget(src, dist) { ...@@ -40,4 +40,4 @@ function generateUploadTarget(src, dist) {
}) })
} }
generateUploadTarget('./dist', '/website/prod/x-learn') generateUploadTarget('./dist', '/website/prod/fd-learn')
差异被折叠。
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src" "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src"
}, },
"dependencies": { "dependencies": {
"axios": "^0.24.0", "axios": "^0.25.0",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"echarts": "^5.2.2", "echarts": "^5.2.2",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"js-base64": "^3.7.2", "js-base64": "^3.7.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"query-string": "^7.0.1", "query-string": "^7.1.0",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-html2pdf": "^1.8.0", "vue-html2pdf": "^1.8.0",
"vue-router": "^3.5.3", "vue-router": "^3.5.3",
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
"eslint-plugin-promise": "^5.1.1", "eslint-plugin-promise": "^5.1.1",
"eslint-plugin-vue": "^7.20.0", "eslint-plugin-vue": "^7.20.0",
"sass": "1.43.5", "sass": "1.43.5",
"vite": "^2.6.14", "vite": "^2.7.13",
"vite-plugin-vue2": "^1.9.0", "vite-plugin-vue2": "^1.9.2",
"vue-template-compiler": "^2.6.14" "vue-template-compiler": "^2.6.14"
} }
} }
...@@ -28,12 +28,7 @@ ...@@ -28,12 +28,7 @@
</template> </template>
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<el-menu-item <el-menu-item :index="item.path" :key="item.title" @click="handleClick(item.path, item)" v-else>
:index="item.path"
:key="item.title"
@click="handleClick(item.path, item)"
v-else
>
<i class="iconfont" :class="item.icon"></i> <i class="iconfont" :class="item.icon"></i>
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</el-menu-item> </el-menu-item>
...@@ -65,6 +60,7 @@ export default { ...@@ -65,6 +60,7 @@ export default {
tag: 'menu_course', tag: 'menu_course',
title: '我的课程', title: '我的课程',
icon: 'icon-bianzu6-hong', icon: 'icon-bianzu6-hong',
path: '/course',
children: [{ tag: 'menu_course_learn', title: '课程学习', path: '/course/learn' }] children: [{ tag: 'menu_course_learn', title: '课程学习', path: '/course/learn' }]
}, },
{ {
...@@ -137,7 +133,7 @@ export default { ...@@ -137,7 +133,7 @@ export default {
// 退出登录 // 退出登录
logout() { logout() {
this.$store.dispatch('logout').then(() => { this.$store.dispatch('logout').then(() => {
window.location.href = import.meta.env.VITE_LOGIN_URL window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
}) })
}, },
handleClick(path, item) { handleClick(path, item) {
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
}, },
computed: { computed: {
user() { user() {
return this.$store.state.user return this.$store.state.user || {}
}, },
avatar() { avatar() {
return this.user.avatar || defaultAvatar return this.user.avatar || defaultAvatar
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
// 退出登录 // 退出登录
logout() { logout() {
this.$store.dispatch('logout').then(() => { this.$store.dispatch('logout').then(() => {
window.location.href = import.meta.env.VITE_LOGIN_URL window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
}) })
} }
} }
......
...@@ -45,9 +45,7 @@ httpRequest.interceptors.response.use( ...@@ -45,9 +45,7 @@ httpRequest.interceptors.response.use(
// 未登录 // 未登录
if (status === 403) { if (status === 403) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else if (status === 400 && code === 401) { } else if (status === 402 || status === 401 || (status === 400 && code === 401)) {
// router.push('/role')
} else if (status === 402) {
router.push('/index') router.push('/index')
} else { } else {
Message.error(message || error.response.data) Message.error(message || error.response.data)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论