Commit 4020281b by 李伟康

增加redirect_uri可携带参数

1 parent cbcc44bf
......@@ -103,7 +103,12 @@ const actions = {
util.removeLocalStorage('dj_scrm_redirect_uri')
// 只有一个账号 history.back()
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 {
......
......@@ -28,7 +28,7 @@ import store from '@/store'
import { Dialog } from 'vant'
export default {
name: 'accountList',
data() {
data () {
return {
accountList: [],
merchantEnum: {
......@@ -37,10 +37,10 @@ export default {
3: '市代',
4: '门店'
},
testView:''
testView: ''
}
},
mounted() {
mounted () {
this.accountList = this.getLocalStorage('dj_scrm_accountList')
},
// watch: {
......@@ -57,7 +57,7 @@ export default {
// }
// },
methods: {
choose(e) {
choose (e) {
this.showLoading(
'',
() => {
......@@ -76,7 +76,7 @@ export default {
if (code == '0') {
if (data) {
if (data.status != 2) {
this.$router.replace({ name: 'common.overdue' })
this.$router.replace({ name: 'common.overdue' })
return
}
let { lastPath } = this.getQuery()
......@@ -88,7 +88,12 @@ export default {
this.removeLocalStorage('dj_scrm_redirect_uri')
this.showLoading('登录成功', () => {
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' })
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!