Эх сурвалжийг харах

0.0.42

生成随机密码
Sean 4 сар өмнө
parent
commit
c3feb63349

+ 4 - 2
src/views/role/components/userAdmin.vue

@@ -275,11 +275,13 @@ export default {
     },
     //重置密码
     resetPassword(){
-      this.$store.dispatch('userMember/resetPassword',{id:this.editId}).then(res=> {
+      let password = Math.random().toString(36).slice(-6); // 随机生成6个字母的组合
+
+      this.$store.dispatch('userMember/resetPassword',{id:this.editId,password:password}).then(res=> {
         if(res.code==200){
           this.$message({
             type: 'success',
-            message: '密码重置为:111111'
+            message: '密码重置为:' + password
           });
         }
       }).catch(() => {

+ 18 - 0
src/views/role/components/userDefault.vue

@@ -560,6 +560,24 @@ export default {
         }
       })
     },
+    //重置密码
+    resetPassword(){
+      let password = Math.random().toString(36).slice(-6); // 随机生成6个字母的组合
+
+      this.$store.dispatch('userMember/resetPassword',{id:this.editId,password:password}).then(res=> {
+        if(res.code==200){
+          this.$message({
+            type: 'success',
+            message: '密码重置为:' + password
+          });
+        }
+      }).catch(() => {
+        this.$message({
+          type: 'warning',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
     //编辑表单 end ------------------------------------------------------------>
     goList(){
       this.$router.push({

+ 4 - 2
src/views/role/components/userEnterprise.vue

@@ -516,11 +516,13 @@ export default {
     },
     //重置密码
     resetPassword(){
-      this.$store.dispatch('userMember/resetPassword',{id:this.editId}).then(res=> {
+      let password = Math.random().toString(36).slice(-6); // 随机生成6个字母的组合
+
+      this.$store.dispatch('userMember/resetPassword',{id:this.editId,password:password}).then(res=> {
         if(res.code==200){
           this.$message({
             type: 'success',
-            message: '密码重置为:111111'
+            message: '密码重置为:' + password
           });
         }
       }).catch(() => {

+ 4 - 2
src/views/role/components/userInvestigate.vue

@@ -623,11 +623,13 @@ export default {
     },
     //重置密码
     resetPassword(){
-      this.$store.dispatch('userMember/resetPassword',{id:this.editId}).then(res=> {
+      let password = Math.random().toString(36).slice(-6); // 随机生成6个字母的组合
+
+      this.$store.dispatch('userMember/resetPassword',{id:this.editId,password:password}).then(res=> {
         if(res.code==200){
           this.$message({
             type: 'success',
-            message: '密码重置为:111111'
+            message: '密码重置为:' + password
           });
         }
       }).catch(() => {

+ 18 - 0
src/views/role/components/userPolitician.vue

@@ -516,6 +516,24 @@ export default {
         }
       })
     },
+    //重置密码
+    resetPassword(){
+      let password = Math.random().toString(36).slice(-6); // 随机生成6个字母的组合
+
+      this.$store.dispatch('userMember/resetPassword',{id:this.editId,password:password}).then(res=> {
+        if(res.code==200){
+          this.$message({
+            type: 'success',
+            message: '密码重置为:' + password
+          });
+        }
+      }).catch(() => {
+        this.$message({
+          type: 'warning',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
     //编辑表单 end ------------------------------------------------------------>
     goList(){
       this.$router.push({