Commit 6226cd86 by 蒋勇

d

parent 7381eed6
......@@ -9,6 +9,10 @@ class UserCtl extends CtlBase {
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){
await this.service.updateByWhere({isEnabled:!pobj.isEnabled},{company_id:pobj.company_id})
return system.getResult({});
......
......@@ -193,7 +193,10 @@ class UserService extends ServiceBase {
let vcodeobj = await this.cacheManager["VCodeCache"].cache(mobile, null, 60);
return vcodeobj.vcode;
}
//修改中心密码
async cmodifypwd(uname,newpwd){
}
//创建统一账号及jwt身份
async cregister(uname, cmpid, pass,uid) {
try {
......@@ -245,6 +248,7 @@ class UserService extends ServiceBase {
return null;
}
}
//登录统一账号
async clogin(uname) {
......@@ -255,6 +259,19 @@ class UserService extends ServiceBase {
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) {
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