add local storage of token and services

This commit is contained in:
Dawn1Ocean
2024-03-20 01:00:50 +08:00
parent f2f4929fc9
commit 9f77cb0f2a
6 changed files with 126 additions and 0 deletions
+10
View File
@@ -3,10 +3,20 @@ import { useLaunch } from '@tarojs/taro';
import 'taro-ui/dist/style/index.scss';
import './app.scss';
import { getLocaleData } from './service/localeData';
import { checkLogin, checkToken } from './service/checkLogin';
import wechatUser from './wechat';
import { loginAte } from './service/login';
import { memberInfo } from './service/memberInfo';
function App({ children }: PropsWithChildren<any>) {
useLaunch(() => {
console.log('App launched.');
if (checkLogin()) {
wechatUser.setToken(checkToken());
memberInfo();
} else {
loginAte();
}
getLocaleData();
});