Browse Source

fixbug: login interface cannot jump to home interface (#1765)

pull/2/head
elonlo 5 years ago committed by Tboy
parent
commit
03ef394399
  1. 8
      dolphinscheduler-ui/src/js/conf/login/App.vue
  2. 2
      dolphinscheduler-ui/src/js/module/io/index.js

8
dolphinscheduler-ui/src/js/conf/login/App.vue

@ -84,8 +84,12 @@
this._gLogin().then(res => { this._gLogin().then(res => {
setTimeout(() => { setTimeout(() => {
this.spinnerLoading = false this.spinnerLoading = false
sessionStorage.setItem("sessionId", res.data) if (res.data.hasOwnProperty("sessionId")) {
cookies.set('sessionId', res.data,{ path: '/' }) let sessionId=res.data.sessionId
sessionStorage.setItem("sessionId", sessionId)
cookies.set('sessionId', sessionId,{ path: '/' })
}
if (this.userName === 'admin') { if (this.userName === 'admin') {
window.location.href = `${PUBLIC_PATH}/#/security/tenant` window.location.href = `${PUBLIC_PATH}/#/security/tenant`
} else { } else {

2
dolphinscheduler-ui/src/js/module/io/index.js

@ -76,7 +76,7 @@ io.interceptors.request.use(
let sIdCookie = cookies.get('sessionId') let sIdCookie = cookies.get('sessionId')
let sessionId = sessionStorage.getItem("sessionId") let sessionId = sessionStorage.getItem("sessionId")
let requstUrl = config.url.substring(config.url.lastIndexOf("/")+1) let requstUrl = config.url.substring(config.url.lastIndexOf("/")+1)
if(requstUrl!=='login' && sIdCookie!=sessionId) { if(sIdCookie !== null && requstUrl!=='login' && sIdCookie!=sessionId) {
window.location.href = `${PUBLIC_PATH}/view/login/index.html` window.location.href = `${PUBLIC_PATH}/view/login/index.html`
} else { } else {
let { method } = config let { method } = config

Loading…
Cancel
Save