Ver código fonte

内容管理分类删除报错trycatch...

wangwei 4 anos atrás
pai
commit
9f38618320
1 arquivos alterados com 8 adições e 4 exclusões
  1. 8 4
      src/views/content/category/index.vue

+ 8 - 4
src/views/content/category/index.vue

@@ -159,10 +159,14 @@
 
       async function handleDelete(record: Recordable) {
         console.log(record);
-        await deleteCategory({ id: record.id }).then(() => {
-          getTableAction().reload();
-          success('删除成功!');
-        });
+        try {
+          await deleteCategory({ id: record.id }).then(() => {
+            getTableAction().reload();
+            success('删除成功!');
+          });
+        } catch (error) {
+          console.log(`error`, error);
+        }
       }
 
       function selectionChange() {