From de1d6bda5b717294904eddb61bf0a3279b3491bd Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 11 Feb 2025 16:34:54 +0800 Subject: [PATCH] fix: Non organizational DingTalk users scan the code to log in - can successfully log in and create a user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1052022 --user=王孝刚 【扫码登录】非组织下钉钉用户扫码登录-可登录成功并创建用户 https://www.tapd.cn/57709429/s/1653465 --- ui/src/views/login/components/dingtalkQrCode.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/src/views/login/components/dingtalkQrCode.vue b/ui/src/views/login/components/dingtalkQrCode.vue index 29952e359..207f3c39a 100644 --- a/ui/src/views/login/components/dingtalkQrCode.vue +++ b/ui/src/views/login/components/dingtalkQrCode.vue @@ -75,6 +75,7 @@ const router = useRouter() const { user } = useStore() const { load } = useScriptTag('https://g.alicdn.com/dingding/h5-dingtalk-login/0.21.0/ddlogin.js') const isConfigReady = ref(false) +const errorShown = ref(false) const initActive = async () => { try { @@ -100,10 +101,11 @@ const initActive = async () => { { redirect_uri: redirectUri, client_id: data.appKey, - scope: 'openid', + scope: 'openid corpid', response_type: 'code', state: 'fit2cloud-ding-qr', - prompt: 'consent' + prompt: 'consent', + corpId: data.corp_id }, (loginResult) => { const authCode = loginResult.authCode @@ -112,8 +114,10 @@ const initActive = async () => { }) }, (errorMsg: string) => { - MsgError(errorMsg) - console.log(errorMsg) + if (!errorShown.value) { + MsgError(errorMsg) + errorShown.value = true // 设置标志位为 true,表示错误已经显示过 + } } ) } catch (error) {