优化HiddenInfo
parent
01cd9c3a2e
commit
26c1abfdbd
|
|
@ -46,13 +46,7 @@ function HiddenInfo(props) {
|
|||
const query = useGetUrlQuery();
|
||||
const { loading: downloadFileLoading, downloadFile } = useDownloadFile();
|
||||
|
||||
const getData = async () => {
|
||||
request(`/hidden/hidden/${id || query[idKey]}`, "get").then((res) => {
|
||||
setInfo(res.data);
|
||||
setLoading(false);
|
||||
onGetData?.(res.data);
|
||||
});
|
||||
|
||||
const getFileData = async (info) => {
|
||||
const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: hiddenId || query[hiddenIdKey] });
|
||||
setHiddenImageFiles(hiddenImageFiles);
|
||||
const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: hiddenId || query[hiddenIdKey] });
|
||||
|
|
@ -78,6 +72,15 @@ function HiddenInfo(props) {
|
|||
const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || query[hiddenIdKey] });
|
||||
setAcceptImageFiles(acceptImageFiles);
|
||||
}
|
||||
}
|
||||
|
||||
const getData = async () => {
|
||||
request(`/hidden/hidden/${id || query[idKey]}`, "get").then((res) => {
|
||||
setInfo(res.data);
|
||||
getFileData(res.data);
|
||||
setLoading(false);
|
||||
onGetData?.(res.data);
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
getData();
|
||||
|
|
|
|||
Loading…
Reference in New Issue