新增图库
This commit is contained in:
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
|
||||
|
||||
const useFetchImageUrl = (imageInstanceId: string) => {
|
||||
const [imageUrl, setImageUrl] = useState("error");
|
||||
const { data: response, run } = useRequest(
|
||||
const { data: response, run, loading } = useRequest(
|
||||
() => {
|
||||
return fetchImage(imageInstanceId);
|
||||
},
|
||||
@@ -25,6 +25,6 @@ const useFetchImageUrl = (imageInstanceId: string) => {
|
||||
run();
|
||||
}
|
||||
}, [imageInstanceId]);
|
||||
return imageUrl;
|
||||
return {imageUrl, loading};
|
||||
};
|
||||
export default useFetchImageUrl;
|
||||
|
||||
Reference in New Issue
Block a user