Browse Source

Merge branch 'master' of http://git.cc-lotus.info/financial_platform/service-financial

wq 4 years ago
parent
commit
f62d2e233c
4 changed files with 19 additions and 1 deletions
  1. 5 0
      app/controller/companyuser.js
  2. 1 0
      app/router.js
  3. 12 0
      app/service/companyuser.js
  4. 1 1
      app/service/intelligentDocking.js

+ 5 - 0
app/controller/companyuser.js

@@ -22,6 +22,11 @@ class CompanyuserController extends Controller {
     const res = await this.service.uppasswd(this.ctx.request.body);
     this.ctx.ok({ data: res });
   }
+
+  async unpasswd() {
+    const res = await this.service.unpasswd(this.ctx.request.body);
+    this.ctx.ok({ data: res });
+  }
 }
 
 module.exports = CrudController(CompanyuserController, meta);

+ 1 - 0
app/router.js

@@ -18,6 +18,7 @@ module.exports = app => {
   router.post('companyuser', '/api/financial/companyuser/update/:id', controller.companyuser.update);
   router.post('companyuser', '/api/financial/companyuser/login', controller.companyuser.login);
   router.post('companyuser', '/api/financial/companyuser/uppasswd', controller.companyuser.uppasswd);
+  router.post('companyuser', '/api/financial/companyuser/unpasswd', controller.companyuser.unpasswd);
 
   // 企业信息表设置路由
   router.resources('company', '/api/financial/company', controller.company); // index、create、show、destroy

+ 12 - 0
app/service/companyuser.js

@@ -51,6 +51,18 @@ class CompanyuserService extends CrudService {
     await user.save();
   }
 
+  // 用户修改密码
+  async unpasswd(data) {
+    const { uid, newpasswd } = data;
+
+    assert(uid && newpasswd, '缺少部分信息项');
+    // 根据用户id查询其他用户表中是否存在相应数据
+    const user = await this.model.findById(uid);
+    const _newpasswd = await this.createJwtPwd(newpasswd);
+    user.passwd = _newpasswd;
+    await user.save();
+  }
+
   async login(data) {
     const { phone, passwd } = data;
     // 根据用户输入的手机号查询其他用户表中是否存在相应数据

+ 1 - 1
app/service/intelligentDocking.js

@@ -94,7 +94,7 @@ class IntelligentDockingService extends CrudService {
         res = error;
       }
     } else {
-      res = '没有符合条件的对接产品,请修改对接需求';
+      res = '没有符合条件的融资产品,请重新调整需求';
     }
     return res;
   }