feat: update of partner
This commit is contained in:
@ -33,6 +33,8 @@ export const isValidUserInfo = (info: UserInfo) => !!info.userId;
|
||||
export const isNeedLogin = (info: UserInfo) => !info.isBindPhone;
|
||||
// export const isNeedLogin = (info: UserInfo) => !info.isBindPhone || info.userId === '534740874077898752';
|
||||
|
||||
export const isNeedPhone = (info: UserInfo) => isNeedLogin(info) || !info.phone;
|
||||
|
||||
export const updateLastLoginTime = () => {
|
||||
lastOpenMiniProgramTime = Taro.getStorageSync<number>(CacheKey.LAST_OPEN_MINI_PROGRAM_TIME) ?? null;
|
||||
const now = Date.now();
|
||||
@ -98,8 +100,8 @@ export const ensureUserInfo = async (info: UserInfo, toast = true) => {
|
||||
|
||||
export const dispatchUpdateUser = (userInfo: Partial<UserInfo>) => store.dispatch(setUserInfo(userInfo));
|
||||
|
||||
export async function requestUserInfo() {
|
||||
const userInfo = await http.post<UserInfo>(API.USER);
|
||||
export async function requestUserInfo(inviteCode?: string) {
|
||||
const userInfo = await http.post<UserInfo>(API.USER, { data: inviteCode ? { inviteCode } : {} });
|
||||
dispatchUpdateUser(userInfo);
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user