Commit f1136e16 by 王昆

gbs

parent 5d5d729c
...@@ -151,6 +151,9 @@ class ActionAPI extends APIBase { ...@@ -151,6 +151,9 @@ class ActionAPI extends APIBase {
case "userPage": case "userPage":
opResult = this.userSve.pageByCondition(action_body); opResult = this.userSve.pageByCondition(action_body);
break; break;
case "updPassword":
opResult = this.userSve.updPassword(action_body);
break;
} }
return opResult; return opResult;
} }
......
...@@ -211,5 +211,16 @@ class UserService extends ServiceBase { ...@@ -211,5 +211,16 @@ class UserService extends ServiceBase {
await this.delete({id: params.id}); await this.delete({id: params.id});
return system.getResultSuccess(); return system.getResultSuccess();
} }
async updPassword(params) {
var user = await this.findById(params.id);
if(!user) {
return system.getResult(null, "用户不存在");
}
user.password = await this.getEncryptStr(params.password);
await user.save();
return system.getResultSuccess();
}
} }
module.exports = UserService; module.exports = UserService;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment