Commit f5fd161d by 李伟康

修复BUG

1 parent f8c4d772
......@@ -66,10 +66,9 @@ const actions = {
console.log('sessionId', sessionId)
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
},
login ({ dispatch }, CORPID) {
login ({ dispatch }) {
let [redirectUrl] = window.location.href.split('?')
const code = getParams('code')
if (CORPID) util.setLocalStorage('dj_scrm_corpId', { corpId: CORPID })
if (code) {
const { corpId } = util.getLocalStorage('dj_scrm_corpId')
ssoApi
......@@ -105,7 +104,7 @@ const actions = {
if (route == 'common/overdue' || route == 'common/nothing') route = ''
if (redirect_uri) {
let [URL, query] = decodeURIComponent(redirect_uri).split('?')
URL = `${URL}?sessionId=${userInfo.sessionId}&corpId=${corpId}}`
URL = `${URL}?sessionId=${userInfo.sessionId}&corpId=${corpId}`
if (query) URL = `${URL}&${query}`
window.location.href = URL
}
......@@ -168,11 +167,11 @@ const actions = {
login({
dispatch,
to
}, corpId)
})
},
}
const login = ({ dispatch, to }, corpId) => {
const login = ({ dispatch, to }) => {
let loginToken = util.getLocalStorage('dj_scrm_loginToken')
let userInfo = util.getLocalStorage('dj_scrm_userInfo')
let sessionId = util.getSessionId()
......@@ -185,7 +184,7 @@ const login = ({ dispatch, to }, corpId) => {
} else {
state.showWindow = false
util.showLoading()
dispatch('login', corpId)
dispatch('login')
return
}
}
......
......@@ -90,7 +90,7 @@ export default {
this.hideLoading()
if (redirect_uri) {
let [URL, query] = decodeURIComponent(redirect_uri).split('?')
URL = `${URL}?sessionId=${data.sessionId}&corpId=${corpId}}`
URL = `${URL}?sessionId=${data.sessionId}&corpId=${corpId}`
if (query) URL = `${URL}&${query}`
window.location.href = URL
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!