add local storage of token and services
This commit is contained in:
+10
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user