增加无权限提醒
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user