添加、创建相关api请求逻辑优化

This commit is contained in:
禺狨
2023-04-07 16:30:41 +08:00
parent 3fa0a50db8
commit 0339e6fcd3
8 changed files with 30 additions and 14 deletions

View File

@@ -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({

View File

@@ -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 = () => {