提交 c35fd61a authored 作者: huaxinzhu's avatar huaxinzhu

Merge branch 'modify_login' into M-2.6

...@@ -4,4 +4,4 @@ NODE_ENV = production ...@@ -4,4 +4,4 @@ NODE_ENV = production
ENV = 'staging' ENV = 'staging'
#gfast管理系统/测试环境 #gfast管理系统/测试环境
VUE_APP_BASE_API = 'http://192.168.26.179:6605/api/v1' VUE_APP_BASE_API = '/api/v1'
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
.catch(() => { .catch(() => {
}) })
sessionStorage.removeItem('saveTitle')
}, },
async logout() { async logout() {
this.$confirm('确定退出系统吗?', '提示', { this.$confirm('确定退出系统吗?', '提示', {
...@@ -145,9 +146,9 @@ export default { ...@@ -145,9 +146,9 @@ export default {
let ssa = window.location.host let ssa = window.location.host
let ht = document.location.protocol let ht = document.location.protocol
if(ssa =='localhost:1024'){ if(ssa =='localhost:1024'){
window.location.href=ht+'//'+this.ssourl +'/logout?redirect='+ht+'//'+ssa+'/login' window.location.href=ht+'//'+this.ssourl +'/api/v2/logout?redirect='+ht+'//'+ssa+'/login'
}else{ }else{
window.location.href=ht+'//'+this.ssourl +'/logout?redirect='+ht+'//'+ssa+'/login' window.location.href=ht+'//'+this.ssourl +'/api/v2/logout?redirect='+ht+'//'+ssa+'/login'
} }
}) })
}) })
......
...@@ -16,7 +16,11 @@ router.beforeEach((to, from, next) => { ...@@ -16,7 +16,11 @@ router.beforeEach((to, from, next) => {
const hasToken = getToken() const hasToken = getToken()
// console.log("getToken()",getToken()) // console.log("getToken()",getToken())
if (hasToken) { if (hasToken) {
getPageTitle() if (sessionStorage.getItem('saveTitle')) {
document.title = sessionStorage.getItem('saveTitle')
} else {
getPageTitle()
}
/* has token*/ /* has token*/
if (to.path === '/platformlogin') { if (to.path === '/platformlogin') {
......
...@@ -8,6 +8,7 @@ export default function getPageTitle() { ...@@ -8,6 +8,7 @@ export default function getPageTitle() {
getBaseSettingTitle({ type: 'SHOP' }).then(res => { getBaseSettingTitle({ type: 'SHOP' }).then(res => {
if (res.code == 1) { if (res.code == 1) {
document.title = res.data document.title = res.data
sessionStorage.setItem('saveTitle', res.data)
} }
}) })
} }
\ No newline at end of file
...@@ -785,14 +785,14 @@ ...@@ -785,14 +785,14 @@
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
let ssa = window.location.host; let ssa = window.location.host;
let ht = document.location.protocol; let ht = document.location.protocol;
window.location.href = ht + '//' + this.ssourl + '/login?redirect=' + ht + '//' + ssa + '/platformlogin' window.location.href = ht + '//' + this.ssourl + '/login.html?redirect=' + ht + '//' + ssa + '/platformlogin'
}) })
}, },
// 去登录 // 去登录
toLogin() { toLogin() {
let ssa = window.location.host; let ssa = window.location.host;
let ht = document.location.protocol; let ht = document.location.protocol;
window.location.href = ht + '//' + this.ssourl + '/login?redirect=' + ht + '//' + ssa + '/platformlogin' window.location.href = ht + '//' + this.ssourl + '/login.html?redirect=' + ht + '//' + ssa + '/platformlogin'
// window.location.href = 'http://sso.jxhh.com/login?redirect=http://' + window.location.host + '/platformlogin' // window.location.href = 'http://sso.jxhh.com/login?redirect=http://' + window.location.host + '/platformlogin'
} }
......
...@@ -67,9 +67,9 @@ export default { ...@@ -67,9 +67,9 @@ export default {
var that = this var that = this
setTimeout(function (){ setTimeout(function (){
if(ssa =='localhost:1024'){ if(ssa =='localhost:1024'){
window.location.href=ht+'//'+that.ssourl+'/login?redirect='+ht+'//'+ssa+'/platformlogin' window.location.href=ht+'//'+that.ssourl+'/login.html?redirect='+ht+'//'+ssa+'/platformlogin'
}else{ }else{
window.location.href=ht+'//'+that.ssourl+'/login?redirect='+ht+'//'+ssa+'/platformlogin' window.location.href=ht+'//'+that.ssourl+'/login.html?redirect='+ht+'//'+ssa+'/platformlogin'
} }
}, 1000) }, 1000)
} }
......
...@@ -89,9 +89,9 @@ ...@@ -89,9 +89,9 @@
let that = this let that = this
setTimeout(function () { setTimeout(function () {
if (ssa == 'localhost:1024') { if (ssa == 'localhost:1024') {
window.location.href = ht+'//'+that.ssourl+'/logout?redirect='+ht+'//' + ssa + '/login' window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
} else { } else {
window.location.href = ht+'//'+that.ssourl+'/logout?redirect='+ht+'//' + ssa + '/login' window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
} }
}, 1000) }, 1000)
} }
...@@ -104,9 +104,9 @@ ...@@ -104,9 +104,9 @@
let that = this let that = this
setTimeout(function () { setTimeout(function () {
if (ssa == 'localhost:1024') { if (ssa == 'localhost:1024') {
window.location.href = ht+'//'+that.ssourl+'/logout?redirect='+ht+'//' + ssa + '/login' window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
} else { } else {
window.location.href = ht+'//'+that.ssourl+'/logout?redirect='+ht+'//' + ssa + '/login' window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
} }
}, 1000) }, 1000)
this.loading = false this.loading = false
......
...@@ -366,9 +366,9 @@ ...@@ -366,9 +366,9 @@
var ssa = window.location.host var ssa = window.location.host
setTimeout(function (){ setTimeout(function (){
if(ssa =='localhost:1024'){ if(ssa =='localhost:1024'){
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login' window.location.href='http://sso.jxhh.com/api/v2/logout?redirect=http://'+ssa+'/login'
}else{ }else{
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login' window.location.href='http://sso.jxhh.com/api/v2/logout?redirect=http://'+ssa+'/login'
} }
}, 1000) }, 1000)
}) })
...@@ -394,9 +394,9 @@ ...@@ -394,9 +394,9 @@
var ssa = window.location.host var ssa = window.location.host
setTimeout(function (){ setTimeout(function (){
if(ssa =='localhost:1024'){ if(ssa =='localhost:1024'){
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login' window.location.href='http://sso.jxhh.com/api/v2/logout?redirect=http://'+ssa+'/login'
}else{ }else{
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login' window.location.href='http://sso.jxhh.com/api/v2/logout?redirect=http://'+ssa+'/login'
} }
}, 1000) }, 1000)
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论