fix: update redirect logic for chat user login in dingtalk and wecom QR code components
This commit is contained in:
parent
00a4b09c99
commit
87eb5a879b
@ -102,26 +102,27 @@ const initActive = async () => {
|
|||||||
{
|
{
|
||||||
redirect_uri: redirectUri,
|
redirect_uri: redirectUri,
|
||||||
client_id: data.appKey,
|
client_id: data.appKey,
|
||||||
scope: 'openid',
|
scope: 'openid corpid',
|
||||||
response_type: 'code',
|
response_type: 'code',
|
||||||
state: 'fit2cloud-ding-chat-qr',
|
state: 'fit2cloud-ding-chat-qr',
|
||||||
prompt: 'consent',
|
prompt: 'consent',
|
||||||
corpId: data.corp_id
|
corpId: data.corp_id
|
||||||
},
|
},
|
||||||
(loginResult) => {
|
(loginResult) => {
|
||||||
console.log(loginResult)
|
|
||||||
const authCode = loginResult.authCode
|
const authCode = loginResult.authCode
|
||||||
chatUser.dingCallback(authCode, accessToken).then(() => {
|
chatUser.dingCallback(authCode, accessToken).then(() => {
|
||||||
router.push({name: 'home'})
|
router.push({
|
||||||
|
name: 'chat',
|
||||||
|
params: {accessToken: accessToken},
|
||||||
|
query: route.query,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
(errorMsg: string) => {
|
(errorMsg: string) => {
|
||||||
console.log(errorMsg)
|
|
||||||
MsgError(errorMsg)
|
MsgError(errorMsg)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { ref, nextTick, defineProps } from 'vue'
|
|||||||
import {MsgError} from '@/utils/message'
|
import {MsgError} from '@/utils/message'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import {getBrowserLang} from '@/locales'
|
import {getBrowserLang} from '@/locales'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
@ -58,7 +59,11 @@ const init = async () => {
|
|||||||
async onLoginSuccess({code}: any) {
|
async onLoginSuccess({code}: any) {
|
||||||
chatUser.wecomCallback(code, accessToken).then(() => {
|
chatUser.wecomCallback(code, accessToken).then(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
router.push({ name: 'home' })
|
router.push({
|
||||||
|
name: 'chat',
|
||||||
|
params: {accessToken: accessToken},
|
||||||
|
query: route.query,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user