增加无权限提醒

This commit is contained in:
liamzi
2025-01-15 15:31:08 +08:00
parent e4db203a9f
commit 81008d0159
13 changed files with 68 additions and 50 deletions

View File

@@ -24,8 +24,6 @@ export const useResources = (initialPagination, initialSorter, type) => {
setCurrentPagination(newPagination);
setCurrentSorter(newSorter);
console.log(params.searchQuery,'params.searchQuery');
const { data, total: newTotal } = await resourceService.getResources({
page: newPagination.current,
pageSize: newPagination.pageSize,
@@ -77,8 +75,6 @@ export const useResources = (initialPagination, initialSorter, type) => {
const deleteResource = async (id) => {
try {
const data= await resourceService.deleteResource(id, type);
console.log(data,data.length,'data');
if(data?.length>0){
const newCurrent =
resources.length === 1 && currentPagination.current > 1
@@ -87,7 +83,7 @@ export const useResources = (initialPagination, initialSorter, type) => {
await fetchResources({ current: newCurrent });
message.success("删除成功");
}else{
throw new Error("no level");
throw new Error("暂无权限");
}
} catch (error) {
throw error;