Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dagouzhi committed Jun 16, 2024
1 parent 79bd35e commit c8eb5be
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
Binary file modified dgz/build/outputs/dist.dgz
Binary file not shown.
5 changes: 5 additions & 0 deletions src/pages/index/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@
.pages-index-loading {
color: #fff;
font-size: 40px;
margin-bottom: 20px;
}

.pages-index-btn {
width: 300px;
}
33 changes: 17 additions & 16 deletions src/pages/index/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
import { View, Text } from '@tarojs/components';
import { View, Text, Button } from '@tarojs/components';
import './index.scss';
import { useCallback, useEffect, useState } from 'react';
import {
UIProvider,
setHomeData,
useAppSelector,
useDispatch,
useUI,
setDBData,
navigate,
} from '@/_UIHOOKS_';
import jsCrawler, { host } from '@/utils/js-crawler';
import { UIProvider, useAppSelector, navigate } from '@/_UIHOOKS_';
import jssdk from '@htyf-mp/js-sdk';
import routes from '@/routes';
import { auth, getSearch } from '@/server/api';
import { auth } from '@/server/api';

function Index() {
const ui = useUI();
const apps = useAppSelector(i => i.apps);
const isDebug = apps?.__ENV__ === 'DEV';
const [msg, setMsg] = useState('验证资源...');
Expand All @@ -26,9 +16,13 @@ function Index() {
setMsg('正在验证真人操作...');
let data = await auth();
resolve(data);
navigate.relaunch({
url: routes.pages.home,
});
if (data) {
navigate.relaunch({
url: routes.pages.home,
});
} else {
setMsg('验证真人操作失败, 请重新验证!');
}
}
});
}, [isDebug]);
Expand All @@ -42,6 +36,13 @@ function Index() {
<View className="pages-index-wrap">
<Text className="pages-index-loading">{msg}</Text>
<Text className="pages-index-loading">请耐心等待~</Text>
<Button
className="pages-index-btn"
onClick={() => {
getData();
}}>
重新验证
</Button>
</View>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/js-crawler.ts

Large diffs are not rendered by default.

0 comments on commit c8eb5be

Please sign in to comment.