#
luxiaotao1123
2025-02-09 d06df946ee95dfb99a6ead6e85f6769cc253e315
rsf-admin/src/page/settings/BaseSettings.jsx
@@ -19,13 +19,26 @@
    CircularProgress,
} from '@mui/material';
import { updateUserInfo } from '@/api/auth';
import avatar from '/avatar.jpg'
const BaseSettings = (props) => {
    const translate = useTranslate();
    const notify = useNotify();
    const { children, value, userInfo } = props;
    const { children, userInfo } = props;
    const { control, handleSubmit, watch, setValue, getValues, formState: { isDirty } } = useForm();
    const {
        control,
        handleSubmit,
        watch,
        setValue,
        getValues,
        reset,
        formState: {
            errors,
            isDirty,
        }
    } = useForm();
    const [loading, setLoading] = useState(false);
    useEffect(() => {
@@ -48,6 +61,13 @@
            const { code, msg, data } = res;
            if (code === 200) {
                notify(msg, { type: 'success', messageArgs: { _: msg } });
                const userToPersist = {
                    avatar: avatar,
                    fullName: data.nickname,
                    id: data.id,
                    username: data.username
                }
                localStorage.setItem("user", JSON.stringify(userToPersist));
            } else {
                notify(msg, { type: 'error', messageArgs: { _: msg } });
            }
@@ -60,7 +80,6 @@
    return (
        <Box
            hidden={value !== 0}
            sx={{
                p: 3,
                flex: 1,