Commit 25b35937 by 孙亚楠

d

parent 71fcd8ba
...@@ -56,6 +56,9 @@ class ActionAPI extends APIBase { ...@@ -56,6 +56,9 @@ class ActionAPI extends APIBase {
case "querySsmUsers": case "querySsmUsers":
opResult = await this.ssmuserSve.querySsmUsers(action_body); opResult = await this.ssmuserSve.querySsmUsers(action_body);
break; break;
case "ssmUserlogin":
opResult = await this.ssmuserSve.ssmUserlogin(action_body);
break;
//ssm end //ssm end
......
...@@ -155,6 +155,33 @@ class SsmuserService extends ServiceBase { ...@@ -155,6 +155,33 @@ class SsmuserService extends ServiceBase {
} }
} }
/**
* fn:ssm用户登录
* @param params
* @returns {Promise<void>}
*/
async ssmUserlogin(params){
if(!params.ucname){
return system.getResult(null, `参数错误 用户名不能为空`);
}
if(!params.password){
return system.getResult(null, `参数错误 密码不能为空`);
}
let ucname = this.trim(params.ucname);
let password = this.trim(params.password);
let pwd = await this.getEncryptStr(password);
var user = await this.dao.getSingleSsmUser({ucname});
if(!user || pwd != user.password) {
return system.getResult(null, "用户名或密码错误");
}
if(!user.isEnabled) {
return system.getResult(null, "用户已禁用");
}
return system.getResultSuccess(user);
}
} }
module.exports = SsmuserService; module.exports = SsmuserService;
\ 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