Commit cea13555 by 王志慧

commit

1 parent ab71dcfc
...@@ -55,6 +55,7 @@ const actions = { ...@@ -55,6 +55,7 @@ const actions = {
}, },
login({ dispatch }) { login({ dispatch }) {
let [redirectUrl] = window.location.href.split('?') let [redirectUrl] = window.location.href.split('?')
console.log(redirectUrl)
// 以下是 本地调试 // 以下是 本地调试
if (process.env.NODE_ENV == 'development') { if (process.env.NODE_ENV == 'development') {
const code = getParams('code') const code = getParams('code')
...@@ -112,9 +113,9 @@ const actions = { ...@@ -112,9 +113,9 @@ const actions = {
}) })
} else { } else {
util.showLoading() util.showLoading()
let { appid } = getParams('corpId')?getParams('corpId'):'' //从链接获取 let { appid } = getParams('corpId') ? getParams('corpId') : '' //从链接获取
let dj_scrm = util.getLocalStorage('dj_scrm_corpId') let dj_scrm = util.getLocalStorage('dj_scrm_corpId')
if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'ww7ee69c648ae1b7e6' if (!appid) appid = (dj_scrm && dj_scrm.corpId) || ''
util.setLocalStorage('dj_scrm_corpId', { corpId: appid }) util.setLocalStorage('dj_scrm_corpId', { corpId: appid })
// 'ww657a2d4ae89a4424' // 'ww657a2d4ae89a4424'
const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize' const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize'
...@@ -122,15 +123,18 @@ const actions = { ...@@ -122,15 +123,18 @@ const actions = {
} }
} else { } else {
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
const reportType = util.getLocalStorage('reportType')
const { baseURL } = window.$fetchConfig.request const { baseURL } = window.$fetchConfig.request
let url = `${baseURL}/dj-scrm-wx-work-main/#/` let url = `${baseURL}/dj-scrm-wx-work-main/#/`
window.location.href = `${url}?redirect_uri=${redirectUrl}&corpId=${storage_corpId.corpId}` console.log('url', url)
window.location.href = `${url}?redirect_uri=${redirectUrl}&corpId=${storage_corpId.corpId}&reportType=${reportType.reportType}`
} }
}, },
navigation({ dispatch }) { navigation({ dispatch }) {
let { sessionId, corpId, reportType } = getParams() let { sessionId, corpId, reportType } = getParams()
console.log('getParams()', getParams())
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
util.setLocalStorage('reportType', { reportType })
if (!corpId) corpId = storage_corpId && storage_corpId.corpId if (!corpId) corpId = storage_corpId && storage_corpId.corpId
if (corpId && storage_corpId) { if (corpId && storage_corpId) {
if (corpId != storage_corpId.corpId) { if (corpId != storage_corpId.corpId) {
...@@ -138,13 +142,16 @@ const actions = { ...@@ -138,13 +142,16 @@ const actions = {
util.clearSessionId() util.clearSessionId()
} }
} }
util.setLocalStorage('reportType', { reportType })
util.setLocalStorage('dj_scrm_corpId', { corpId }) util.setLocalStorage('dj_scrm_corpId', { corpId })
const storage_sessionId = util.getSessionId() const storage_sessionId = util.getSessionId()
if (sessionId || storage_sessionId) { if (sessionId || storage_sessionId) {
console.log(222222222)
state.showWindow = true state.showWindow = true
util.setSessionId(sessionId || storage_sessionId) util.setSessionId(sessionId || storage_sessionId)
dispatch('registerHttp', sessionId || storage_sessionId) dispatch('registerHttp', sessionId || storage_sessionId)
} else { } else {
console.log(333333333)
util.showLoading() util.showLoading()
dispatch('registerHttp') dispatch('registerHttp')
dispatch('login') dispatch('login')
......
...@@ -51,6 +51,8 @@ export default { ...@@ -51,6 +51,8 @@ export default {
this.getData() this.getData()
}, },
created() { created() {
console.log('this.getQuery()',this.getQuery())
console.log(window.localStorage.getItem('reportType'))
let reportType = this.getQuery().reportType ? this.getQuery().reportType : JSON.parse(window.localStorage.getItem('reportType')).reportType let reportType = this.getQuery().reportType ? this.getQuery().reportType : JSON.parse(window.localStorage.getItem('reportType')).reportType
// let reportType =1 // let reportType =1
if (reportType == 0) { if (reportType == 0) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!