Skip to content

Commit 763b3f4

Browse files
committed
fix: Non organizational DingTalk users scan the code to log in - can successfully log in and create a user
--bug=1052022 --user=王孝刚 【扫码登录】非组织下钉钉用户扫码登录-可登录成功并创建用户 https://www.tapd.cn/57709429/s/1653465
1 parent 89c08b4 commit 763b3f4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ui/src/views/login/components/dingtalkQrCode.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const router = useRouter()
7575
const { user } = useStore()
7676
const { load } = useScriptTag('https://g.alicdn.com/dingding/h5-dingtalk-login/0.21.0/ddlogin.js')
7777
const isConfigReady = ref(false)
78+
const errorShown = ref(false)
7879
7980
const initActive = async () => {
8081
try {
@@ -100,10 +101,11 @@ const initActive = async () => {
100101
{
101102
redirect_uri: redirectUri,
102103
client_id: data.appKey,
103-
scope: 'openid',
104+
scope: 'openid corpid',
104105
response_type: 'code',
105106
state: 'fit2cloud-ding-qr',
106-
prompt: 'consent'
107+
prompt: 'consent',
108+
corpId: data.corp_id
107109
},
108110
(loginResult) => {
109111
const authCode = loginResult.authCode
@@ -112,8 +114,10 @@ const initActive = async () => {
112114
})
113115
},
114116
(errorMsg: string) => {
115-
MsgError(errorMsg)
116-
console.log(errorMsg)
117+
if (!errorShown.value) {
118+
MsgError(errorMsg)
119+
errorShown.value = true // 设置标志位为 true,表示错误已经显示过
120+
}
117121
}
118122
)
119123
} catch (error) {

0 commit comments

Comments
 (0)