提交 0078d673 authored 作者: zyx's avatar zyx

容器化修改统一登录

上级 0ba88a01
...@@ -3,7 +3,8 @@ module.exports = { ...@@ -3,7 +3,8 @@ module.exports = {
DesDir: '../client-dist', DesDir: '../client-dist',
apiBaseURL: '/', apiBaseURL: '/',
others: { others: {
url: '/app/learn/course' url: '/app/learn/course',
loginUrl: 'https://login.ezijing.com/sofia/login/index'
}, },
webpack: { webpack: {
externals: { externals: {
......
...@@ -3,7 +3,8 @@ module.exports = { ...@@ -3,7 +3,8 @@ module.exports = {
DesDir: '../client-dist', DesDir: '../client-dist',
apiBaseURL: '/', apiBaseURL: '/',
others: { others: {
url: '/app/learn/course' url: '/app/learn/course',
loginUrl: 'https://login.ezijing.com/sofia/login/index'
}, },
isUploadStatic: false, isUploadStatic: false,
webpack: { webpack: {
......
...@@ -73,9 +73,10 @@ export default class API { ...@@ -73,9 +73,10 @@ export default class API {
if (/\/login\/index/gi.test(href)) { if (/\/login\/index/gi.test(href)) {
_vIn.$router.go(0) _vIn.$router.go(0)
} else { } else {
_vIn.$router.push({ // _vIn.$router.push({
path: '/login/index?rd=' + encodeURIComponent(href.replace(/.*?\/\/.*?\//gi, '/')) // path: '/login/index?rd=' + encodeURIComponent(href.replace(/.*?\/\/.*?\//gi, '/'))
}) // })
window.location.href = webConf.others.loginUrl + '?rd=' + encodeURIComponent(href.replace(/.*?\/\/.*?\//gi, '/'))
} }
} }
......
...@@ -24,10 +24,11 @@ export default class Before { ...@@ -24,10 +24,11 @@ export default class Before {
// 检测登录状态 // 检测登录状态
const isLogin = await this.isLogin() const isLogin = await this.isLogin()
if (!isLogin) { if (!isLogin) {
next({ // next({
path: '/login/index', // path: '/login/index',
query: { rd: encodeURIComponent(to.fullPath) } // query: { rd: encodeURIComponent(to.fullPath) }
}) // })
window.location.href = webConf.others.loginUrl + '?rd=' + encodeURIComponent(to.fullPath)
return return
} }
// 移动端 // 移动端
......
...@@ -126,7 +126,8 @@ export default { ...@@ -126,7 +126,8 @@ export default {
cAction.Other.outLogin() cAction.Other.outLogin()
.then(str => { .then(str => {
window.G.UserInfo = {} window.G.UserInfo = {}
this.$router.push({ path: '/login/index' }) // this.$router.push({ path: '/login/index' })
window.location.href = webConf.others.loginUrl
}) })
.catch(e => { .catch(e => {
this.$message.error(e.message) this.$message.error(e.message)
......
...@@ -67,7 +67,8 @@ export default { ...@@ -67,7 +67,8 @@ export default {
cAction.Other.outLogin() cAction.Other.outLogin()
.then(str => { .then(str => {
window.G.UserInfo = {} window.G.UserInfo = {}
this.$router.push({ path: '/login/index' }) // this.$router.push({ path: '/login/index' })
window.location.href = webConf.others.loginUrl
}) })
.catch(e => { .catch(e => {
this.$message.error(e.message) this.$message.error(e.message)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论