Commit 6226cd86 by 蒋勇

d

parent 7381eed6
...@@ -9,6 +9,10 @@ class UserCtl extends CtlBase { ...@@ -9,6 +9,10 @@ class UserCtl extends CtlBase {
super("auth", CtlBase.getServiceName(UserCtl)); super("auth", CtlBase.getServiceName(UserCtl));
} }
async resetPassword(pobj, qobj, req){
await this.service.resetPassword(req.xctx.username,pobj.onepassword)
return system.getResult({});
}
async allowOrNot(pobj, qobj, req){ async allowOrNot(pobj, qobj, req){
await this.service.updateByWhere({isEnabled:!pobj.isEnabled},{company_id:pobj.company_id}) await this.service.updateByWhere({isEnabled:!pobj.isEnabled},{company_id:pobj.company_id})
return system.getResult({}); return system.getResult({});
......
...@@ -193,7 +193,10 @@ class UserService extends ServiceBase { ...@@ -193,7 +193,10 @@ class UserService extends ServiceBase {
let vcodeobj = await this.cacheManager["VCodeCache"].cache(mobile, null, 60); let vcodeobj = await this.cacheManager["VCodeCache"].cache(mobile, null, 60);
return vcodeobj.vcode; return vcodeobj.vcode;
} }
//修改中心密码
async cmodifypwd(uname,newpwd){
}
//创建统一账号及jwt身份 //创建统一账号及jwt身份
async cregister(uname, cmpid, pass,uid) { async cregister(uname, cmpid, pass,uid) {
try { try {
...@@ -245,6 +248,7 @@ class UserService extends ServiceBase { ...@@ -245,6 +248,7 @@ class UserService extends ServiceBase {
return null; return null;
} }
} }
//登录统一账号 //登录统一账号
async clogin(uname) { async clogin(uname) {
...@@ -255,6 +259,19 @@ class UserService extends ServiceBase { ...@@ -255,6 +259,19 @@ class UserService extends ServiceBase {
async findCUser(uname) { async findCUser(uname) {
} }
async resetPassword(uname,pwd){
let inpassword = this.getEncryptStr(pwd);
var self=this;
return this.db.transaction(async function (t) {
let up=await self.dao.updateByWhere({password:inpassword},{userName:uname}, t);
//令缓存失效
await this.cacheManager["UserCache"].invalidate(uname);
//修改认证中心的tag密码
let cacheUser=await this.cacheManager["UserCache"].cache(up.userName);
return cacheUser;
});
}
//修改 //修改
async update(qobj, tm = null) { async update(qobj, tm = null) {
var self=this; var self=this;
......
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