Commit 4020281b by 李伟康

增加redirect_uri可携带参数

1 parent cbcc44bf
...@@ -103,7 +103,12 @@ const actions = { ...@@ -103,7 +103,12 @@ const actions = {
util.removeLocalStorage('dj_scrm_redirect_uri') util.removeLocalStorage('dj_scrm_redirect_uri')
// 只有一个账号 history.back() // 只有一个账号 history.back()
if (route == 'common/overdue' || route == 'common/nothing') route = '' if (route == 'common/overdue' || route == 'common/nothing') route = ''
if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${userInfo.sessionId}&corpId=${corpId}&${new Date().getTime()}`) if (redirect_uri) {
let [URL, query] = decodeURIComponent(redirect_uri).split('?')
URL = `${URL}?sessionId=${userInfo.sessionId}&corpId=${corpId}}`
if (query) URL = `${URL}&${query}`
window.location.href = URL
}
else window.location.replace(`${url}${route}`) else window.location.replace(`${url}${route}`)
} }
} else { } else {
......
...@@ -28,7 +28,7 @@ import store from '@/store' ...@@ -28,7 +28,7 @@ import store from '@/store'
import { Dialog } from 'vant' import { Dialog } from 'vant'
export default { export default {
name: 'accountList', name: 'accountList',
data() { data () {
return { return {
accountList: [], accountList: [],
merchantEnum: { merchantEnum: {
...@@ -37,10 +37,10 @@ export default { ...@@ -37,10 +37,10 @@ export default {
3: '市代', 3: '市代',
4: '门店' 4: '门店'
}, },
testView:'' testView: ''
} }
}, },
mounted() { mounted () {
this.accountList = this.getLocalStorage('dj_scrm_accountList') this.accountList = this.getLocalStorage('dj_scrm_accountList')
}, },
// watch: { // watch: {
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
// } // }
// }, // },
methods: { methods: {
choose(e) { choose (e) {
this.showLoading( this.showLoading(
'', '',
() => { () => {
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
if (code == '0') { if (code == '0') {
if (data) { if (data) {
if (data.status != 2) { if (data.status != 2) {
this.$router.replace({ name: 'common.overdue' }) this.$router.replace({ name: 'common.overdue' })
return return
} }
let { lastPath } = this.getQuery() let { lastPath } = this.getQuery()
...@@ -88,7 +88,12 @@ export default { ...@@ -88,7 +88,12 @@ export default {
this.removeLocalStorage('dj_scrm_redirect_uri') this.removeLocalStorage('dj_scrm_redirect_uri')
this.showLoading('登录成功', () => { this.showLoading('登录成功', () => {
this.hideLoading() this.hideLoading()
if (redirect_uri) window.location.href = decodeURIComponent(`${redirect_uri}?sessionId=${data.sessionId}&corpId=${corpId}&${new Date().getTime()}`) if (redirect_uri) {
let [URL, query] = decodeURIComponent(redirect_uri).split('?')
URL = `${URL}?sessionId=${data.sessionId}&corpId=${corpId}}`
if (query) URL = `${URL}&${query}`
window.location.href = URL
}
else this.$router.replace({ name: lastPath || 'home' }) else this.$router.replace({ name: lastPath || 'home' })
}) })
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!