feat: add change user-config

This commit is contained in:
2025-04-03 19:22:41 +08:00
parent 1e10c8529e
commit 521255c1af
25 changed files with 1667 additions and 762 deletions

View File

@@ -14,21 +14,15 @@ import { useTranslation } from 'react-i18next';
import React from 'react';
export const LayoutUser = () => {
const { open, setOpen, ...store } = useLayoutStore(
const { open, setOpen, isAdmin, ...store } = useLayoutStore(
useShallow((state) => ({
open: state.openUser, //
setOpen: state.setOpenUser,
me: state.me,
switchOrg: state.switchOrg,
isAdmin: state.isAdmin,
})),
);
const [isAdmin, setIsAdmin] = useState<boolean>(false);
useEffect(() => {
queryLogin.cacheStore.getCurrentUser().then((res) => {
const org = res?.orgs || [];
setIsAdmin(org.includes('admin'));
});
}, []);
const navigate = useNewNavigate();
const { t } = useTranslation();
const items = useMemo(() => {
@@ -89,7 +83,7 @@ export const LayoutUser = () => {
};
return (
<div className={clsx('w-full h-full absolute z-20 no-drag ', !open && 'hidden')}>
<div className={clsx('w-full h-full absolute z-20 no-drag text-primary', !open && 'hidden')}>
<div
className='w-full absolute h-full opacity-60 z-0'
onClick={() => {