zhaoke 2 жил өмнө
parent
commit
3d60854c29

+ 9 - 0
src/api/newLogin.js

@@ -44,6 +44,15 @@ export function changePassword (params) {
   })
 }
 
+//忘记密码
+export function changeSecpasswd (params) {
+  return request({
+    url: '/foxlibc/reset-secpasswd',
+    method: 'post',
+    data: params
+  })
+}
+
 //权限获取
 export function permission (params) {
   return request({

+ 1 - 0
src/layout/index.vue

@@ -154,6 +154,7 @@ export default {
       try {
         const res = await changePassword({
           username: this.name,
+          userId: sessionStorage.getItem('User_Id'),
           originPassword: MD5(this.dataForm.old),
           // passwd: MD5(this.dataForm.again),
           newPassword: this.dataForm.again,

+ 5 - 8
src/views/accountManagement/components/accountHome.vue

@@ -155,6 +155,7 @@ import NoData from "@/components/nodata";
 import { translateDataToTreeAll } from "@/utils/validate";
 import { mapGetters } from "vuex";
 import { GeneralDataReception, Query } from "@/api/dataIntegration";
+import { changeSecpasswd } from '@/api/newLogin';
 import MD5 from "blueimp-md5";
 export default {
   components: { Search, Dialog, NoData },
@@ -457,10 +458,8 @@ export default {
       //   path: '/account/accountAdd'
       // })
     },
-    authUser (userId) {
+    authUser () {
       this.pwdflag = true;
-      this.roleId = userId;
-      this.getAccountInfo();
     },
     //存储数据项-提交
     addSubmit (formName) {
@@ -470,11 +469,9 @@ export default {
             this.$message.error("两次输入的密码不一致,请重新输入");
             return false;
           }
-          this.dataForm.user_sec_pwd = MD5(this.dataForm.again)
-          const obj = Object.assign(this.ruleForm, this.dataForm)
-          const { code, message } = await GeneralDataReception({
-            serviceId: SERVICE_ID.accountScId,
-            dataContent: JSON.stringify(obj),
+          const { code, message } = await changeSecpasswd({
+            userId: sessionStorage.getItem('User_Id'),
+            newPassword: this.dataForm.again,
           });
           if (code == 0) {
             this.$message.success(message);