Commit f1136e16 by 王昆

gbs

parent 5d5d729c
......@@ -151,6 +151,9 @@ class ActionAPI extends APIBase {
case "userPage":
opResult = this.userSve.pageByCondition(action_body);
break;
case "updPassword":
opResult = this.userSve.updPassword(action_body);
break;
}
return opResult;
}
......
......@@ -211,5 +211,16 @@ class UserService extends ServiceBase {
await this.delete({id: params.id});
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;
\ 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