Commit f5fd161d by 李伟康

修复BUG

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