统一应用初始化

feature/price_manager
Jimmy Liow 1 year ago
parent 51aa59abe1
commit a3d02f4caf

@ -46,11 +46,13 @@ import './i18n';
const { loginToken, userId } = usingStorage()
const initAppliction = async () => {
if (isNotEmpty(loginToken)) {
appendRequestParams('token', loginToken)
}
if (isNotEmpty(userId)) {
appendRequestParams('wu_id', userId)
await fireAuth()
}
}

@ -32,7 +32,7 @@ function App() {
const [validateUserPassword, tokenTimeout, isPermitted] = useAuthStore(
(state) => [state.validateUserPassword, state.tokenTimeout, state.isPermitted])
const { loginToken, userDetail, userId } = usingStorage()
const { loginToken } = usingStorage()
const noticeUnRead = useNoticeStore((state) => state.noticeUnRead)
const href = useHref()
@ -42,10 +42,6 @@ function App() {
// /p...
const needToLogin = href !== '/login' && isEmpty(loginToken)
if (!needToLogin) {
appendRequestParams('token', loginToken)
appendRequestParams('wu_id', userId)
}
useEffect(() => {
fetchUserDetail(loginToken)
.then(u => {

Loading…
Cancel
Save