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 => {
setTimeout(() => {
this.spinnerLoading = false
sessionStorage.setItem("sessionId", res.data)
cookies.set('sessionId', res.data,{ path: '/' })
if (res.data.hasOwnProperty("sessionId")) {
let sessionId=res.data.sessionId
sessionStorage.setItem("sessionId", sessionId)
cookies.set('sessionId', sessionId,{ path: '/' })
}
if (this.userName === 'admin') {
window.location.href = `${PUBLIC_PATH}/#/security/tenant`
} else {

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

@ -76,7 +76,7 @@ io.interceptors.request.use(
let sIdCookie = cookies.get('sessionId')
let sessionId = sessionStorage.getItem("sessionId")
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`
} else {
let { method } = config

Loading…
Cancel
Save