feat:移动端使用免登授权码

main
LiaoYijun 9 months ago
parent b691b584a5
commit de96b0a8d1

@ -21,11 +21,10 @@ function Callback() {
const originUrl = urlSearch.get('origin_url')
useEffect (() => {
if (isNotEmpty(authCode) && state === 'global-saels') {
if (state === 'global-saels' && isNotEmpty(authCode)) {
login(authCode)
} else if (isNotEmpty(authCode) && state === 'jsapi-auth') {
// https://p9axztuwd7x8a7.mycht.cn/dingtalk/dingtalkwork/Getusers_auth_wa
// loginByJSAuth()
} else if (state === 'jsapi-auth' && isNotEmpty(authCode)) {
loginByJSAuth(authCode)
} else {
console.error('error: ' + error)
}

@ -32,25 +32,25 @@ function Login() {
</Flex>
)
}
window.location = redirectUrl
// if (dingTalkPlatForm === 'notInDingTalk') {
// window.location = redirectUrl
// } else {
// dd.requestAuthCode({
// clientId: 'dingl3jyntkazyg4coxf',
// corpId: 'ding48bce8fd3957c96b',
// success: (res) => {
// const { code } = res
// navigate('/p/dingding/callback?state=jsapi-auth&authCode=' + code, {
// replace: true,
// })
// },
// fail: (error) => {
// setErrorMsg(JSON.stringify(error))
// },
// complete: () => {},
// })
// }
if (dingTalkPlatForm === 'notInDingTalk') {
window.location = redirectUrl
} else {
dd.requestAuthCode({
clientId: 'dingl3jyntkazyg4coxf',
corpId: 'ding48bce8fd3957c96b',
success: (res) => {
const { code } = res
navigate('/p/dingding/callback?state=jsapi-auth&authCode=' + code, {
replace: true,
})
},
fail: (error) => {
setErrorMsg(JSON.stringify(error))
},
complete: () => {},
})
}
return (
<Flex justify='center' align='center' gap='middle' vertical>

Loading…
Cancel
Save