From ae1b411fcb54f794646b32b29c47cb380163f95e Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 17 二月 2025 14:32:05 +0800
Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/flexJobMiniApp

---
 apps/cMiniApp/src/stores/modules/user.ts |   55 ++++++-------------------------------------------------
 1 files changed, 6 insertions(+), 49 deletions(-)

diff --git a/apps/cMiniApp/src/stores/modules/user.ts b/apps/cMiniApp/src/stores/modules/user.ts
index 43f3e84..31de28b 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) {}
     },
@@ -309,38 +288,16 @@
       }
     },
 
-    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');
-      }
-    },
-
     setLocationCity(cityName: string, provinceName: string) {
       this.locationCity = cityName;
       this.locationProvince = provinceName;
       this.firstSetLocation = false;
       setStorageLocationCity({ city: cityName, province: provinceName });
-      if (LocationUtils.isProvinceChange(provinceName)) {
-        this.resetState();
-        myClient.removeQueries();
-        globalEventEmitter.trigger('logout/refresh');
-        // myClient.invalidateQueries({
-        //   queryKey: ['logout/refresh'],
-        // });
-      }
+      // if (LocationUtils.isProvinceChange(provinceName)) {
+      //   this.resetState();
+      //   myClient.removeQueries();
+      //   globalEventEmitter.trigger('logout/refresh');
+      // }
       LocationUtils.currentProvinceName = provinceName;
     },
   },

--
Gitblit v1.9.1