fix: 修复前端报错的缺陷

--bug=1048335 --user=王孝刚 【系统设置】扫描登录页面弹出错误信息:Missing parameters https://www.tapd.cn/57709429/s/1601519
This commit is contained in:
wxg0103 2024-10-30 10:00:38 +08:00 committed by wxg0103
parent 527ddbf1e8
commit 10a7edd54a

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="flex-center mb-16"> <div class="flex-center mb-16">
<img src="@/assets/logo_dingtalk.svg " alt="" width="24px" class="mr-4" /> <img src="@/assets/logo_dingtalk.svg" alt="" width="24px" class="mr-4" />
<h2>钉钉扫码登录</h2> <h2>钉钉扫码登录</h2>
</div> </div>
<div class="ding-talk-qrName"> <div class="ding-talk-qrName">
@ -66,7 +66,7 @@ const props = defineProps<{
config: { config: {
app_secret: string app_secret: string
app_key: string app_key: string
corp_id?: string crop_id: string
} }
}>() }>()
@ -81,15 +81,15 @@ const initActive = async () => {
if (!isConfigReady.value) { if (!isConfigReady.value) {
return return
} }
console.log(props.config)
const data = { const data = {
appKey: props.config.app_key, appKey: props.config.app_key,
appSecret: props.config.app_secret, appSecret: props.config.app_secret,
corp_id: props.config.corp_id crop_id: props.config.crop_id
} }
const redirectUri = encodeURIComponent(window.location.origin) const redirectUri = encodeURIComponent(window.location.origin)
window.DTFrameLogin( window.DTFrameLogin(
{ {
id: 'ding-talk-qr', id: 'ding-talk-qr',
@ -98,13 +98,13 @@ const initActive = async () => {
}, },
{ {
redirect_uri: redirectUri, redirect_uri: redirectUri,
client_id: data.appKey || '', client_id: data.appKey,
scope: 'openid', scope: 'openid',
response_type: 'code', response_type: 'code',
state: 'fit2cloud-ding-qr', state: 'fit2cloud-ding-qr',
prompt: 'consent', prompt: 'consent',
exclusiveLogin: 'true', exclusiveLogin: 'true',
exclusiveCorpId: data.corp_id exclusiveCorpId: data.crop_id
}, },
(loginResult) => { (loginResult) => {
const authCode = loginResult.authCode const authCode = loginResult.authCode
@ -122,7 +122,7 @@ const initActive = async () => {
} }
onMounted(() => { onMounted(() => {
// config // Simulate config loading completion
setTimeout(() => { setTimeout(() => {
isConfigReady.value = true isConfigReady.value = true
initActive() initActive()