Przeglądaj źródła

修改错误提示方法

david 2 lat temu
rodzic
commit
1659cbbbff
1 zmienionych plików z 12 dodań i 3 usunięć
  1. 12 3
      src/views/login/modify-password.vue

+ 12 - 3
src/views/login/modify-password.vue

@@ -31,6 +31,7 @@
 //   import axiosObj from '../../utils/axiosPlugin'
   import tool from '@/utils/tool'
   import { noLoginModifyPassword } from '@/api/user'
+  import ElementUI from 'element-ui'
   
   export default {
     name: 'modify-password',
@@ -54,11 +55,19 @@
         let objectThis = this
         noLoginModifyPassword(this.passwordInfo).then(response => {
             this.modifyPasswordButtonStat = false
-            this.$message.success(response.data)
+            // this.$message.success(response.message)
+            this.$message({
+                message: response.message,
+                type: 'success'
+              })
             objectThis.$router.push('/login')
         }).catch(err => {
-            this.$message.error(err)
-            this.modifyPasswordButtonStat = false
+          this.$message({
+            message: err,
+            type: 'error'
+          })
+            // this.$message.error(err)
+          this.modifyPasswordButtonStat = false
         })
         // axiosObj.post(path, this.passwordInfo).then(response => {
         //   this.$message.success(response)