Skip to content

Commit 87eb5a8

Browse files
committed
fix: update redirect logic for chat user login in dingtalk and wecom QR code components
1 parent 00a4b09 commit 87eb5a8

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

ui/src/views/chat/user-login/scanCompinents/dingtalkQrCode.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,27 @@ const initActive = async () => {
102102
{
103103
redirect_uri: redirectUri,
104104
client_id: data.appKey,
105-
scope: 'openid',
105+
scope: 'openid corpid',
106106
response_type: 'code',
107107
state: 'fit2cloud-ding-chat-qr',
108108
prompt: 'consent',
109109
corpId: data.corp_id
110110
},
111111
(loginResult) => {
112-
console.log(loginResult)
113112
const authCode = loginResult.authCode
114113
chatUser.dingCallback(authCode, accessToken).then(() => {
115-
router.push({name: 'home'})
114+
router.push({
115+
name: 'chat',
116+
params: {accessToken: accessToken},
117+
query: route.query,
118+
})
116119
})
117120
},
118121
(errorMsg: string) => {
119-
console.log(errorMsg)
120122
MsgError(errorMsg)
121123
}
122124
)
123125
} catch (error) {
124-
console.error(error)
125126
}
126127
}
127128

ui/src/views/chat/user-login/scanCompinents/wecomQrCode.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@ import {
1111
WWLoginRedirectType,
1212
WWLoginType
1313
} from '@wecom/jssdk'
14-
import { ref, nextTick, defineProps } from 'vue'
15-
import { MsgError } from '@/utils/message'
14+
import {ref, nextTick, defineProps} from 'vue'
15+
import {MsgError} from '@/utils/message'
1616
import useStore from '@/stores'
17-
import { getBrowserLang } from '@/locales'
17+
import {getBrowserLang} from '@/locales'
18+
1819
const router = useRouter()
1920
const route = useRoute()
2021
const {
2122
params: {accessToken},
2223
} = route as any
2324
const wwLogin = ref({})
24-
const obj = ref<any>({ isWeComLogin: false })
25-
const { chatUser } = useStore()
25+
const obj = ref<any>({isWeComLogin: false})
26+
const {chatUser} = useStore()
2627
2728
const props = defineProps<{
2829
config: {
@@ -55,10 +56,14 @@ const init = async () => {
5556
panel_size: WWLoginPanelSizeType.small
5657
},
5758
onCheckWeComLogin: obj.value,
58-
async onLoginSuccess({ code }: any) {
59+
async onLoginSuccess({code}: any) {
5960
chatUser.wecomCallback(code, accessToken).then(() => {
6061
setTimeout(() => {
61-
router.push({ name: 'home' })
62+
router.push({
63+
name: 'chat',
64+
params: {accessToken: accessToken},
65+
query: route.query,
66+
})
6267
})
6368
})
6469
},

0 commit comments

Comments
 (0)