Browse Source

feat[litemall-admin]: 管理后台前端进一步显示后端错误信息

Junling Bu 7 years ago
parent
commit
4ca3da285d

+ 2 - 4
litemall-admin/src/views/goods/create.vue

@@ -370,11 +370,9 @@
           attributes: this.attributes
           attributes: this.attributes
         }
         }
         publishGoods(finalGoods).then(response => {
         publishGoods(finalGoods).then(response => {
-          this.$notify({
+          this.$notify.success({
             title: '成功',
             title: '成功',
-            message: '创建成功',
-            type: 'success',
-            duration: 2000
+            message: '创建成功'
           })
           })
           this.$router.push({ path: '/goods/list' })
           this.$router.push({ path: '/goods/list' })
         }).catch(response => {
         }).catch(response => {

+ 2 - 4
litemall-admin/src/views/goods/edit.vue

@@ -364,11 +364,9 @@ export default {
         attributes: this.attributes
         attributes: this.attributes
       }
       }
       editGoods(finalGoods).then(response => {
       editGoods(finalGoods).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '创建成功',
-          type: 'success',
-          duration: 2000
+          message: '创建成功'
         })
         })
         this.$router.push({ path: '/goods/list' })
         this.$router.push({ path: '/goods/list' })
       }).catch(response => {
       }).catch(response => {

+ 7 - 4
litemall-admin/src/views/goods/list.vue

@@ -196,14 +196,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteGoods(row).then(response => {
       deleteGoods(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 21 - 12
litemall-admin/src/views/mall/brand.vue

@@ -204,11 +204,14 @@ export default {
           createBrand(this.dataForm).then(response => {
           createBrand(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '创建成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -234,11 +237,14 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -246,14 +252,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteBrand(row).then(response => {
       deleteBrand(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 21 - 12
litemall-admin/src/views/mall/category.vue

@@ -264,11 +264,14 @@ export default {
           createCategory(this.dataForm).then(response => {
           createCategory(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '创建成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -294,11 +297,14 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -306,14 +312,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteCategory(row).then(response => {
       deleteCategory(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 21 - 12
litemall-admin/src/views/mall/issue.vue

@@ -140,11 +140,14 @@ export default {
           createIssue(this.dataForm).then(response => {
           createIssue(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '创建成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -170,11 +173,14 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -182,14 +188,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteIssue(row).then(response => {
       deleteIssue(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 21 - 12
litemall-admin/src/views/mall/keyword.vue

@@ -175,11 +175,14 @@ export default {
           createKeyword(this.dataForm).then(response => {
           createKeyword(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '创建成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -205,11 +208,14 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -217,14 +223,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteKeyword(row).then(response => {
       deleteKeyword(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 14 - 8
litemall-admin/src/views/mall/order.vue

@@ -262,13 +262,16 @@ export default {
         if (valid) {
         if (valid) {
           shipOrder(this.shipForm).then(response => {
           shipOrder(this.shipForm).then(response => {
             this.shipDialogVisible = false
             this.shipDialogVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '确认发货成功',
-              type: 'success',
-              duration: 2000
+              message: '确认发货成功'
             })
             })
             this.getList()
             this.getList()
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
+            })
           })
           })
         }
         }
       })
       })
@@ -287,13 +290,16 @@ export default {
         if (valid) {
         if (valid) {
           refundOrder(this.refundForm).then(response => {
           refundOrder(this.refundForm).then(response => {
             this.refundDialogVisible = false
             this.refundDialogVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '确认退款成功',
-              type: 'success',
-              duration: 2000
+              message: '确认退款成功'
             })
             })
             this.getList()
             this.getList()
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
+            })
           })
           })
         }
         }
       })
       })

+ 1 - 2
litemall-admin/src/views/mall/region.vue

@@ -68,8 +68,7 @@ export default {
       const typeMap = {
       const typeMap = {
         '1': '省',
         '1': '省',
         '2': '市',
         '2': '市',
-        '3': '区',
-        '4': '街道'
+        '3': '区'
       }
       }
       return typeMap[status]
       return typeMap[status]
     }
     }

+ 21 - 12
litemall-admin/src/views/promotion/ad.vue

@@ -234,11 +234,14 @@ export default {
           createAd(this.dataForm).then(response => {
           createAd(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '创建成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -264,11 +267,14 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新广告成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -276,14 +282,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteAd(row).then(response => {
       deleteAd(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 21 - 12
litemall-admin/src/views/promotion/grouponRule.vue

@@ -178,11 +178,14 @@
             publishGroupon(this.dataForm).then(response => {
             publishGroupon(this.dataForm).then(response => {
               this.list.unshift(response.data.data)
               this.list.unshift(response.data.data)
               this.dialogFormVisible = false
               this.dialogFormVisible = false
-              this.$notify({
+              this.$notify.success({
                 title: '成功',
                 title: '成功',
-                message: '创建成功',
-                type: 'success',
-                duration: 2000
+                message: '创建团购规则成功'
+              })
+            }).catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
               })
               })
             })
             })
           }
           }
@@ -208,11 +211,14 @@
                 }
                 }
               }
               }
               this.dialogFormVisible = false
               this.dialogFormVisible = false
-              this.$notify({
+              this.$notify.success({
                 title: '成功',
                 title: '成功',
-                message: '更新成功',
-                type: 'success',
-                duration: 2000
+                message: '更新团购规则成功'
+              })
+            }).catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
               })
               })
             })
             })
           }
           }
@@ -220,14 +226,17 @@
       },
       },
       handleDelete(row) {
       handleDelete(row) {
         deleteGroupon(row).then(response => {
         deleteGroupon(row).then(response => {
-          this.$notify({
+          this.$notify.success({
             title: '成功',
             title: '成功',
-            message: '删除成功',
-            type: 'success',
-            duration: 2000
+            message: '删除团购规则成功'
           })
           })
           const index = this.list.indexOf(row)
           const index = this.list.indexOf(row)
           this.list.splice(index, 1)
           this.list.splice(index, 1)
+        }).catch(response => {
+          this.$notify.error({
+            title: '失败',
+            message: response.data.errmsg
+          })
         })
         })
       },
       },
       handleDownload() {
       handleDownload() {

+ 21 - 12
litemall-admin/src/views/promotion/topic.vue

@@ -253,11 +253,14 @@ export default {
           createTopic(this.dataForm).then(response => {
           createTopic(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '创建专题成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -287,11 +290,14 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新专题成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -299,14 +305,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteTopic(row).then(response => {
       deleteTopic(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除专题成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 21 - 12
litemall-admin/src/views/sys/admin.vue

@@ -221,11 +221,14 @@ export default {
           createAdmin(this.dataForm).then(response => {
           createAdmin(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '添加管理员成功'
+            }).catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
             })
             })
           })
           })
         }
         }
@@ -251,11 +254,14 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新管理员成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -263,14 +269,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteAdmin(row).then(response => {
       deleteAdmin(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除管理员成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 16 - 12
litemall-admin/src/views/sys/os.vue

@@ -147,11 +147,9 @@ export default {
       createStorage(formData).then(response => {
       createStorage(formData).then(response => {
         this.list.unshift(response.data.data)
         this.list.unshift(response.data.data)
         this.createDialogVisible = false
         this.createDialogVisible = false
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '创建成功',
-          type: 'success',
-          duration: 2000
+          message: '上传成功'
         })
         })
       }).catch(() => {
       }).catch(() => {
         this.$message.error('上传失败,请重新上传')
         this.$message.error('上传失败,请重新上传')
@@ -176,11 +174,14 @@ export default {
               }
               }
             }
             }
             this.updateDialogVisible = false
             this.updateDialogVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -188,14 +189,17 @@ export default {
     },
     },
     handleDelete(row) {
     handleDelete(row) {
       deleteStorage(row).then(response => {
       deleteStorage(row).then(response => {
-        this.$notify({
+        this.$notify.success({
           title: '成功',
           title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+          message: '删除成功'
         })
         })
         const index = this.list.indexOf(row)
         const index = this.list.indexOf(row)
         this.list.splice(index, 1)
         this.list.splice(index, 1)
+      }).catch(response => {
+        this.$notify.error({
+          title: '失败',
+          message: response.data.errmsg
+        })
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {

+ 18 - 44
litemall-admin/src/views/user/user.vue

@@ -70,10 +70,7 @@
         </el-form-item>
         </el-form-item>
         <el-form-item label="密码" prop="password">
         <el-form-item label="密码" prop="password">
           <el-input type="password" v-model="dataForm.password" auto-complete="off"></el-input>
           <el-input type="password" v-model="dataForm.password" auto-complete="off"></el-input>
-        </el-form-item>
-        <el-form-item label="确认密码" prop="checkPassword">
-          <el-input type="password" v-model="dataForm.checkPassword" auto-complete="off"></el-input>
-        </el-form-item>        
+        </el-form-item>     
         <el-form-item label="性别" prop="gender">
         <el-form-item label="性别" prop="gender">
           <el-select v-model="dataForm.gender">
           <el-select v-model="dataForm.gender">
             <el-option label="未知" :value="0">
             <el-option label="未知" :value="0">
@@ -125,25 +122,6 @@ import { fetchList, createUser, updateUser } from '@/api/user'
 export default {
 export default {
   name: 'User',
   name: 'User',
   data() {
   data() {
-    var validatePass = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请输入密码'))
-      } else {
-        if (this.dataForm.checkPassword !== '') {
-          this.$refs.dataForm.validateField('checkPassword')
-        }
-        callback()
-      }
-    }
-    var validatePass2 = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请再次输入密码'))
-      } else if (value !== this.dataForm.password) {
-        callback(new Error('两次输入密码不一致!'))
-      } else {
-        callback()
-      }
-    }
     return {
     return {
       list: null,
       list: null,
       total: null,
       total: null,
@@ -161,7 +139,6 @@ export default {
         username: '',
         username: '',
         mobile: '',
         mobile: '',
         password: undefined,
         password: undefined,
-        checkPassword: undefined,
         gender: 0,
         gender: 0,
         userLevel: 0,
         userLevel: 0,
         birthday: undefined,
         birthday: undefined,
@@ -176,14 +153,7 @@ export default {
       rules: {
       rules: {
         username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
         username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
         mobile: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }],
         mobile: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }],
-        password: [
-          { required: true, message: '密码不能为空', trigger: 'blur' },
-          { validator: validatePass, trigger: 'blur' }
-        ],
-        checkPassword: [
-          { required: true, message: '密码不能为空', trigger: 'blur' },
-          { validator: validatePass2, trigger: 'blur' }
-        ]
+        password: [{ required: true, message: '密码不能为空', trigger: 'blur' }]
       },
       },
       downloadLoading: false,
       downloadLoading: false,
       genderDic: ['未知', '男', '女'],
       genderDic: ['未知', '男', '女'],
@@ -246,11 +216,14 @@ export default {
           createUser(this.dataForm).then(response => {
           createUser(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '创建成功',
-              type: 'success',
-              duration: 2000
+              message: '添加用户成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
@@ -276,22 +249,23 @@ export default {
               }
               }
             }
             }
             this.dialogFormVisible = false
             this.dialogFormVisible = false
-            this.$notify({
+            this.$notify.success({
               title: '成功',
               title: '成功',
-              message: '更新成功',
-              type: 'success',
-              duration: 2000
+              message: '更新成功'
+            })
+          }).catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
             })
           })
           })
         }
         }
       })
       })
     },
     },
     handleDelete(row) {
     handleDelete(row) {
-      this.$notify({
+      this.$notify.error({
         title: '警告',
         title: '警告',
-        message: '用户删除操作不支持!',
-        type: 'warning',
-        duration: 3000
+        message: '用户删除操作不支持!'
       })
       })
     },
     },
     handleDownload() {
     handleDownload() {