Explorar el Código

fix: 显示后端报错信息

kuanghua liu hace 1 año
padre
commit
385ee5bb35
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      src/views/system/user/component/AddUser.vue

+ 5 - 3
src/views/system/user/component/AddUser.vue

@@ -313,18 +313,20 @@
           type: 'success',
         });
         emits('update:modelValue', true);
+        // window.location.reload();
+      } else {
+        DialogVisible.value = true;
       }
       cardVisible.value = false;
     } catch (error) {
       ElMessage({
-        message: response.message,
+        // console.log(res),
+        message: response.data.msg,
         type: 'error',
       });
       emits('update:modelValue', false);
     }
 
-    DialogVisible.value = true;
-
     // if (isSuc.value) {
     //   DialogVisibleSuc.value = true;
     //   DialogVisibleErr.value = false;