add 404 page
This commit is contained in:
+1
-17
@@ -2,29 +2,13 @@ import { PropsWithChildren } from 'react';
|
||||
import { useLaunch } from '@tarojs/taro';
|
||||
import 'taro-ui/dist/style/index.scss';
|
||||
import './app.scss';
|
||||
import { checkLogin, checkToken } from './service/checkLogin';
|
||||
import wechatUser from './wechat';
|
||||
import { loginAte } from './service/login';
|
||||
import { getInfo } from './service/getInfo';
|
||||
import { pingAte } from './service/pingAte';
|
||||
|
||||
function App({ children }: PropsWithChildren<any>) {
|
||||
useLaunch(() => {
|
||||
console.log('App launched.');
|
||||
pingAte((res) => {
|
||||
if (res) {
|
||||
checkLogin((success) => {
|
||||
if (success) {
|
||||
wechatUser.setToken(checkToken());
|
||||
getInfo();
|
||||
} else {
|
||||
loginAte();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
pingAte();
|
||||
});
|
||||
|
||||
// children 是将要会渲染的页面
|
||||
return children;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user