mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
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
This commit is contained in:
parent
89c08b4bb0
commit
de1d6bda5b
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue