修改env

This commit is contained in:
liamzi
2025-01-13 18:29:59 +08:00
parent 0f0c463c5e
commit 952edee24d
7 changed files with 36 additions and 13 deletions

View File

@@ -76,15 +76,18 @@ export const useResources = (initialPagination, initialSorter, type) => {
const deleteResource = async (id) => {
try {
await resourceService.deleteResource(id, type);
const data= await resourceService.deleteResource(id, type);
if(data?.length>0){
const newCurrent =
resources.length === 1 && currentPagination.current > 1
? currentPagination.current - 1
: currentPagination.current;
await fetchResources({ current: newCurrent });
message.success("删除成功");
}else{
throw new Error("no level");
}
} catch (error) {
message.error("删除失败");
throw error;
}
};