mirror of
https://github.com/PlayEdu/backend
synced 2025-12-23 11:39:51 +08:00
添加、创建相关api请求逻辑优化
This commit is contained in:
@@ -23,8 +23,10 @@ export const MemberCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
|
||||
const [avatar, setAvatar] = useState<string>(getHost() + "avatar/avatar.png");
|
||||
|
||||
useEffect(() => {
|
||||
getParams();
|
||||
}, []);
|
||||
if (open) {
|
||||
getParams();
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
useEffect(() => {
|
||||
form.setFieldsValue({
|
||||
|
||||
@@ -35,10 +35,12 @@ export const MemberUpdate: React.FC<PropInterface> = ({
|
||||
}, [id, open]);
|
||||
|
||||
useEffect(() => {
|
||||
getParams();
|
||||
form.setFieldsValue({
|
||||
password: "",
|
||||
});
|
||||
if (open) {
|
||||
getParams();
|
||||
form.setFieldsValue({
|
||||
password: "",
|
||||
});
|
||||
}
|
||||
}, [form, open]);
|
||||
|
||||
const getParams = () => {
|
||||
|
||||
Reference in New Issue
Block a user