fix: include accessToken in WeCom QR code iframe URL
parent
b148152c94
commit
e8c6e75a09
|
|
@ -6,7 +6,9 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref, nextTick, defineProps} from 'vue'
|
import {ref, nextTick, defineProps} from 'vue'
|
||||||
import {getBrowserLang} from '@/locales'
|
import {getBrowserLang} from '@/locales'
|
||||||
|
import {useRoute} from "vue-router";
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
config: {
|
config: {
|
||||||
app_secret: string
|
app_secret: string
|
||||||
|
|
@ -17,6 +19,10 @@ const props = defineProps<{
|
||||||
}
|
}
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const {
|
||||||
|
params: {accessToken},
|
||||||
|
} = route as any
|
||||||
|
|
||||||
const iframeUrl = ref('')
|
const iframeUrl = ref('')
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
await nextTick() // 确保DOM已更新
|
await nextTick() // 确保DOM已更新
|
||||||
|
|
@ -34,7 +40,7 @@ const init = async () => {
|
||||||
const redirectUri = encodeURIComponent(data.redirectUri)
|
const redirectUri = encodeURIComponent(data.redirectUri)
|
||||||
console.log('redirectUri', data.redirectUri)
|
console.log('redirectUri', data.redirectUri)
|
||||||
// 手动构建生成二维码的url
|
// 手动构建生成二维码的url
|
||||||
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`
|
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`
|
||||||
}
|
}
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue