perf: Team org ui (#3499)

* perf: org ui

* perf: org ui
This commit is contained in:
Archer
2024-12-30 20:49:11 +08:00
committed by archer
parent 1fc77a126a
commit efecfd44c3
21 changed files with 505 additions and 563 deletions

View File

@@ -19,6 +19,7 @@ type State = {
setSysMsgReadId: (id: string) => void;
userInfo: UserType | null;
isTeamAdmin: boolean;
initUserInfo: () => Promise<UserType>;
setUserInfo: (user: UserType | null) => void;
updateUserInfo: (user: UserUpdateParams) => Promise<void>;
@@ -50,6 +51,7 @@ export const useUserStore = create<State>()(
},
userInfo: null,
isTeamAdmin: false,
async initUserInfo() {
get().initTeamPlanStatus();
@@ -67,6 +69,7 @@ export const useUserStore = create<State>()(
setUserInfo(user: UserType | null) {
set((state) => {
state.userInfo = user ? user : null;
state.isTeamAdmin = !!user?.team?.permission?.hasManagePer;
});
},
async updateUserInfo(user: UserUpdateParams) {