Commit 38e51a95 by 王志慧

commit

1 parent cea13555
......@@ -55,7 +55,6 @@ const actions = {
},
login({ dispatch }) {
let [redirectUrl] = window.location.href.split('?')
console.log(redirectUrl)
// 以下是 本地调试
if (process.env.NODE_ENV == 'development') {
const code = getParams('code')
......@@ -122,19 +121,17 @@ const actions = {
window.location.href = `${wxUrl}?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
}
} else {
let { reportType } = getParams()
util.setLocalStorage('reportType', { reportType })
const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
const reportType = util.getLocalStorage('reportType')
const { baseURL } = window.$fetchConfig.request
let url = `${baseURL}/dj-scrm-wx-work-main/#/`
console.log('url', url)
window.location.href = `${url}?redirect_uri=${redirectUrl}&corpId=${storage_corpId.corpId}&reportType=${reportType.reportType}`
window.location.href = `${url}?redirect_uri=${redirectUrl}&corpId=${storage_corpId.corpId}`
}
},
navigation({ dispatch }) {
let { sessionId, corpId, reportType } = getParams()
console.log('getParams()', getParams())
const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
if (!corpId) corpId = storage_corpId && storage_corpId.corpId
if (corpId && storage_corpId) {
if (corpId != storage_corpId.corpId) {
......@@ -146,12 +143,10 @@ const actions = {
util.setLocalStorage('dj_scrm_corpId', { corpId })
const storage_sessionId = util.getSessionId()
if (sessionId || storage_sessionId) {
console.log(222222222)
state.showWindow = true
util.setSessionId(sessionId || storage_sessionId)
dispatch('registerHttp', sessionId || storage_sessionId)
} else {
console.log(333333333)
util.showLoading()
dispatch('registerHttp')
dispatch('login')
......
......@@ -51,8 +51,6 @@ export default {
this.getData()
},
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 =1
if (reportType == 0) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!