fix(login): login change

This commit is contained in:
2026-03-16 15:48:39 +08:00
parent 48be2c675e
commit e6f6b98fc1
6 changed files with 87 additions and 30 deletions

View File

@@ -0,0 +1,38 @@
import { create } from "zustand"
import { persist } from "zustand/middleware"
const initUserInfo = {
user_id: null,
user_name: null,
user_password: null,
detailInfo: null,
}
export const usePermissionStore = create(
persist<any>(
(set) => ({
user_id: null,
user_name: null,
user_password: null,
detailInfo: null,
setUserPermissionInfo: ({ user_id, user_name, detailInfo }: any) =>
set({
user_id,
user_name,
detailInfo,
user_password: usePermissionStore.getState().user_password,
}),
setUserPassword: (user_password: string) =>
set((state: any) => {
return {
...state,
user_password,
}
}),
logout: () => set(initUserInfo),
}),
{
name: "label_permission",
}
)
)