添加、创建相关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

@@ -57,8 +57,10 @@ export const CourseCreate: React.FC<PropInterface> = ({
const [addvideoCurrent, setAddvideoCurrent] = useState(0);
useEffect(() => {
getParams();
getCategory();
if (open) {
getParams();
getCategory();
}
}, [open, cateIds, depIds]);
useEffect(() => {

View File

@@ -46,8 +46,10 @@ export const CourseUpdate: React.FC<PropInterface> = ({
const [type, setType] = useState<string>("open");
useEffect(() => {
getCategory();
getParams();
if (open) {
getParams();
getCategory();
}
}, [form, open]);
useEffect(() => {