Commit 82264ebb by 蒋勇

Merge branch 'bigdata' of gitlab.gongsibao.com:jiangyong/zhichan into bigdata

parents 6cfc5538 5b7a1a92
...@@ -127,8 +127,26 @@ class AccessAuthAPI extends APIBase { ...@@ -127,8 +127,26 @@ class AccessAuthAPI extends APIBase {
var opencode = super.getUUID(); var opencode = super.getUUID();
var authUrl = req.app.authUrl + "?opencode=" + opencode; var authUrl = req.app.authUrl + "?opencode=" + opencode;
await this.cacheManager["OpenCodeCache"].cache(opencode, ruser, 30); await this.cacheManager["OpenCodeCache"].cache(opencode, ruser, 30);
return system.getResultSuccess({ auth_url: authUrl, opencode: opencode, open_user_id: ruser.id }); return system.getResultSuccess({ auth_url: authUrl, opencode: opencode, open_user_id: ruser.id, account_id: ruser.account_id });
} }
async modifyPassword(pobj, qobj, req) {
if (!pobj.account_id) {
return system.getResult(null, "用户名不能为空");
}
if (!pobj.password) {
return system.getResult(null, "密码不能为空");
}
var param = {
account_id: pobj.account_id,
password: pobj.password,
}
await this.userSve.modifyPassword(param);
return system.getResultSuccess();
}
async login(pobj, qobj, req) { async login(pobj, qobj, req) {
if (!pobj.userName) { if (!pobj.userName) {
return system.getResult(null, "用户名不能为空"); return system.getResult(null, "用户名不能为空");
......
...@@ -285,6 +285,20 @@ class UserService extends ServiceBase { ...@@ -285,6 +285,20 @@ class UserService extends ServiceBase {
} }
}); });
} }
async modifyPassword(p) {
p.password = await super.getEncryptStr(p.password);
var setObj = {
password: p.password
};
var whereObj = {
where: {account_id: p.account_id}
};
await this.dao.updateByWhere(setObj, whereObj);
return system.getResultSuccess();
}
async getUserByUserNamePwdForApi(u) { async getUserByUserNamePwdForApi(u) {
//勇于从别的应用中,点击页面连接,跳转到平台应用中进行管理 //勇于从别的应用中,点击页面连接,跳转到平台应用中进行管理
u.password = await super.getEncryptStr(u.password); u.password = await super.getEncryptStr(u.password);
......
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