| | |
| | | obj.username = data.enterpriseName; |
| | | storageLocal().setItem(userKey, obj); |
| | | } |
| | | |
| | | export function setRoleListInfo(data: DataInfo<Date>) { |
| | | useUserStoreHook().SET_ROLES_LIST(data); |
| | | storageLocal().setItem("rolesList", data); |
| | | } |
| | | |
| | | export function setNowRole(data: DataInfo<Date>) { |
| | | const list = storageLocal().getItem<DataInfo<number>>(userKey)?.exRoles ?? []; |
| | | if (list.length > 0) { |
| | | const obj = list.find(item => { |
| | | return item.code == data.code; |
| | | }); |
| | | data = { ...obj, ...data }; |
| | | } |
| | | useUserStoreHook().SET_NOW_ROLE(data); |
| | | storageLocal().setItem("nowRole", data); |
| | | } |
| | | |
| | | export function removeEnterpriseInfo() { |
| | | storageLocal().removeItem("enterpriseInfo"); |
| | | } |