From 0470145fcd755d3f87bffc7a985bd3cc82c5f3f6 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期一, 10 二月 2025 16:30:40 +0800 Subject: [PATCH] feat: init --- apps/cMiniApp/src/stores/modules/user.ts | 42 +----------------------------------------- 1 files changed, 1 insertions(+), 41 deletions(-) diff --git a/apps/cMiniApp/src/stores/modules/user.ts b/apps/cMiniApp/src/stores/modules/user.ts index 43f3e84..7e52ace 100644 --- a/apps/cMiniApp/src/stores/modules/user.ts +++ b/apps/cMiniApp/src/stores/modules/user.ts @@ -26,7 +26,7 @@ LocationUtils, } from '@12333/utils'; import DefaultAvatar from '@/assets/components/icon-default-avatar.png'; -import { MatchMakingIdentityEnum, WxMiniAppEnum } from '@12333/constants'; +import { WxMiniAppEnum } from '@12333/constants'; import { myClient } from '@/constants/query'; import { globalEventEmitter } from '@12333/hooks'; @@ -36,9 +36,6 @@ refreshToken?: Nullable<string>; userDetail?: Nullable<API.UserInfoV2>; firstGetUserDetail?: boolean; - matchMakingIdentity?: MatchMakingIdentityEnum; - /**鏄惁鏈夎缃繃韬唤 */ - isSetMatchMakingIdentity?: boolean; locationCity?: string; locationProvince?: string; @@ -61,18 +58,6 @@ } ); -function initMatchMakingIdentity(userDetail: API.UserInfoV2): MatchMakingIdentityEnum { - if (!userDetail) { - const cacheMatchMakingIdentity = getMatchMakingIdentity(); - return cacheMatchMakingIdentity - ? cacheMatchMakingIdentity - : MatchMakingIdentityEnum.Contributors; - } else if (!userDetail?.matchMakingIdentity) { - return MatchMakingIdentityEnum.Contributors; - } - return userDetail?.matchMakingIdentity; -} - export const useUserStore = defineStore({ id: 'app-user', state: (): UserState => { @@ -89,10 +74,6 @@ refreshToken: userInfo?.refreshToken ?? '', userDetail: userDetail, firstGetUserDetail: true, - matchMakingIdentity: initMatchMakingIdentity(userDetail), - isSetMatchMakingIdentity: userDetail - ? !!userDetail.matchMakingIdentity || !!getMatchMakingIdentity() - : !!getMatchMakingIdentity(), locationCity: storageLocation?.city ?? '鍖椾含甯�', locationProvince: storageLocation?.province ?? '鍖椾含', firstSetLocation: true, @@ -227,8 +208,6 @@ res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar; this.setUserDetail(res); this.firstGetUserDetail = false; - this.matchMakingIdentity = initMatchMakingIdentity(res); - this.isSetMatchMakingIdentity = true; } } catch (error) {} }, @@ -303,25 +282,6 @@ return res; } else { throw new Error('鍒锋柊token澶辫触'); - } - } catch (error) { - throw new Error('error'); - } - }, - - async setMatchMakingIdentity(params: API.SetMatchMakingIdentityInput) { - try { - let res = 1; - if (this.userDetail) { - res = await userServices.setMatchMakingIdentity(params); - } - if (res) { - if (!this.userDetail) { - setMatchMakingIdentity(params.matchMakingIdentity); - } - this.matchMakingIdentity = params.matchMakingIdentity; - this.isSetMatchMakingIdentity = true; - return res; } } catch (error) { throw new Error('error'); -- Gitblit v1.9.1