|
@@ -14,6 +14,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
|
|
let [loading, setLoading] = useState(false)
|
|
let [loading, setLoading] = useState(false)
|
|
let [codeUrl, setCodeUrl] = useState('')
|
|
let [codeUrl, setCodeUrl] = useState('')
|
|
let [err, setErr] = useState({})
|
|
let [err, setErr] = useState({})
|
|
|
|
+ let [outTime,setOutTime]=useState(0)
|
|
let [data, setData] = useState({
|
|
let [data, setData] = useState({
|
|
userId: localStorage.getItem('userId'),
|
|
userId: localStorage.getItem('userId'),
|
|
adAppType,
|
|
adAppType,
|
|
@@ -46,8 +47,9 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
|
|
setCodeUrl(r?.data?.codeImgUrl)
|
|
setCodeUrl(r?.data?.codeImgUrl)
|
|
setVisible(true)
|
|
setVisible(true)
|
|
let n = 0
|
|
let n = 0
|
|
|
|
+ let overTime = data.smType === 'QQ' ? 60 : 240
|
|
time = setInterval(() => {
|
|
time = setInterval(() => {
|
|
- if (n < 60) {
|
|
|
|
|
|
+ if ( n < overTime) {
|
|
n += 1
|
|
n += 1
|
|
fetch(`${api}/qq/isOk?userId=${localStorage.getItem('userId')}&smType=${data.smType}`, {
|
|
fetch(`${api}/qq/isOk?userId=${localStorage.getItem('userId')}&smType=${data.smType}`, {
|
|
method: 'GET'
|
|
method: 'GET'
|
|
@@ -66,7 +68,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
|
|
clearInterval(time)
|
|
clearInterval(time)
|
|
setLoading(false)
|
|
setLoading(false)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ setOutTime(overTime-n)
|
|
}, 1000)
|
|
}, 1000)
|
|
} else {
|
|
} else {
|
|
message.success('已经开始授权,稍后自行查看结果!如遇到问题请点击清除账号状态按钮重试!')
|
|
message.success('已经开始授权,稍后自行查看结果!如遇到问题请点击清除账号状态按钮重试!')
|
|
@@ -167,11 +169,12 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
|
|
maskClosable={false}
|
|
maskClosable={false}
|
|
title={<>{data?.smType === 'QQ' ? "QQ扫码" : "微信扫码"}</>}
|
|
title={<>{data?.smType === 'QQ' ? "QQ扫码" : "微信扫码"}</>}
|
|
>
|
|
>
|
|
- <div style={{ display: 'flex', justifyItems: "center", alignItems: 'center' }}>
|
|
|
|
|
|
+ <div style={{ display: 'flex', justifyItems: "center", alignItems: 'center',flexFlow:'column' }}>
|
|
<Image
|
|
<Image
|
|
style={{ width: 150 }}
|
|
style={{ width: 150 }}
|
|
src={codeUrl} />
|
|
src={codeUrl} />
|
|
- <strong style={{ color: 'red', width: '100%', textAlign: 'center' }}>扫码成功后自动关闭窗口</strong>
|
|
|
|
|
|
+ <strong style={{ color: 'red', width: '100%', textAlign: 'center' }}>扫码成功后或超时自动关闭窗口</strong>
|
|
|
|
+ <strong style={{ color: 'red', width: '100%', textAlign: 'center' }}>{outTime > 0 ? outTime : ""}</strong>
|
|
</div>
|
|
</div>
|
|
</Modal>
|
|
</Modal>
|
|
</div>
|
|
</div>
|