shenwu 2 年之前
父节点
当前提交
82149f8e84
共有 2 个文件被更改,包括 27 次插入12 次删除
  1. 1 1
      src/pages/adMonitor/adMonitorList/tablePlanListConfig.tsx
  2. 26 11
      src/pages/launchSystemNew/account/qqAuto.tsx

+ 1 - 1
src/pages/adMonitor/adMonitorList/tablePlanListConfig.tsx

@@ -543,7 +543,7 @@ function columnsMonitor(details: (id: number) => void) {
                 align: 'center',
                 width: 90,
                 render: (a: any, b: any) => {
-                    return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adgroup?query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%2${b.adgroupId}%22}`)} target="_blank">腾讯广告</a>
+                    return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adgroup?query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroupId}%22}`)} target="_blank">腾讯广告</a>
                 }
             }
         ]

+ 26 - 11
src/pages/launchSystemNew/account/qqAuto.tsx

@@ -11,6 +11,7 @@ let api= "http://47.99.157.216:8023"
 function QQAuth(props: { qqVisible: boolean, callBack: () => void }) {
     const { qqVisible, callBack } = props
     let [visible, setVisible] = useState(false)
+    let [loading,setLoading]=useState(false)
     let [codeUrl, setCodeUrl] = useState('')
     let [err, setErr] = useState({})
     let [data, setData] = useState({
@@ -28,6 +29,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void }) {
             message.error('账号请使用数字!!!!!!')
             return
         }
+        setLoading(true)
         fetch(api+'/qq/auth', {
             method: 'POST',
             headers: {
@@ -38,19 +40,32 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void }) {
             if (r?.data?.codeImgUrl) {
                 setCodeUrl(r?.data?.codeImgUrl)
                 setVisible(true)
+                let n=0
                 time = setInterval(() => {
-                    fetch(`${api}/qq/isOk?userId=${localStorage.getItem('userId')}`, {
-                        method: 'GET'
-                    }).then(res => res.json()).then(r => {
-                        if (r.data) {
-                            setVisible(false)
-                            setCodeUrl("")
-                            clearInterval(time)
-                        }
-                    })
+                    if(n< 60){
+                        n+=1
+                        fetch(`${api}/qq/isOk?userId=${localStorage.getItem('userId')}`, {
+                            method: 'GET'
+                        }).then(res => res.json()).then(r => {
+                            if (r.data) {
+                                setVisible(false)
+                                setCodeUrl("")
+                                clearInterval(time)
+                                setLoading(false)
+                            }
+                        })
+                    }else{
+                        message.error('扫码超时请重新扫码!')
+                        setVisible(false)
+                        setCodeUrl("")
+                        clearInterval(time)
+                        setLoading(false)
+                    }
+                   
                 }, 1000)
             } else {
                 message.success('已经开始授权,稍后自行查看结果!')
+                setLoading(false)
             }
             console.log(r)
         })
@@ -106,8 +121,8 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void }) {
             </Row>
             <Row style={{ display: 'flex', justifyContent: 'center', marginTop: 20 }}>
                 <Space>
-                    <Button type='primary' onClick={submit}>提交</Button>
-                    <Button type='default' onClick={query}>查询授权失败账号</Button>
+                    <Button type='primary' onClick={submit} loading={loading}>提交</Button>
+                    <Button type='default' onClick={query} >查询授权失败账号</Button>
                     <Popconfirm title={'清除账号状态将清除所有失败记录,并清空上一次扫码授权状态!'} onConfirm={del} >
                         <Button type='primary' danger >清除账号状态</Button>
                     </Popconfirm>