Skip to content

Commit 10dbda2

Browse files
committed
fix: include accessToken in WeCom QR code iframe URL
1 parent d7127b9 commit 10dbda2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
<script lang="ts" setup>
77
import {ref, nextTick, defineProps} from 'vue'
88
import {getBrowserLang} from '@/locales'
9+
import {useRoute} from "vue-router";
910
11+
const route = useRoute()
1012
const props = defineProps<{
1113
config: {
1214
app_secret: string
@@ -17,6 +19,10 @@ const props = defineProps<{
1719
}
1820
}>()
1921
22+
const {
23+
params: {accessToken},
24+
} = route as any
25+
2026
const iframeUrl = ref('')
2127
const init = async () => {
2228
await nextTick() // 确保DOM已更新
@@ -34,7 +40,7 @@ const init = async () => {
3440
const redirectUri = encodeURIComponent(data.redirectUri)
3541
console.log('redirectUri', data.redirectUri)
3642
// 手动构建生成二维码的url
37-
iframeUrl.value = `https://login.work.weixin.qq.com/wwlogin/sso/login?login_type=CorpApp&appid=${data.corpId}&agentid=${data.agentId}&redirect_uri=${redirectUri}&state=fit2cloud-wecom-qr&lang=${lang}&lang=${lang}&panel_size=small`
43+
iframeUrl.value = `https://login.work.weixin.qq.com/wwlogin/sso/login?login_type=CorpApp&appid=${data.corpId}&agentid=${data.agentId}&redirect_uri=${redirectUri}&accessToken=${accessToken}&state=fit2cloud-wecom-qr&lang=${lang}&lang=${lang}&panel_size=small`
3844
}
3945
4046
init()

0 commit comments

Comments
 (0)