Commit adae7ccc by 高宇强

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents 51cfcbd2 5593527a
......@@ -23,7 +23,7 @@ class AccessAuthAPI extends APIBase {
}
async opActionProcess(pobj, action_type, req) {
var opResult = system.getResult(null, "req Failure");
pobj.actionBody.userpin = this.getUUID();
pobj.actionBody.userpin = pobj.actionBody.userpin || this.getUUID();
switch (action_type) {
// sy
case "test"://测试
......@@ -62,10 +62,10 @@ class AccessAuthAPI extends APIBase {
}
break;
case "logout":
opResult = await this.utilsAuthSve.userLogout(pobj,pobj.actionBody);
opResult = await this.utilsAuthSve.userLogout(pobj, pobj.actionBody);
break;
case "putUserPwdByMobile":
opResult = await this.utilsAuthSve.putUserPwdByMobile(pobj,pobj.actionBody);
opResult = await this.utilsAuthSve.putUserPwdByMobile(pobj, pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -102,7 +102,7 @@ class UtilsAuthSve extends AppServiceBase {
if (result.status == 0 && actionBody.userpin) {
this.userLogout(pobj, actionBody);
}
return system.getResultSuccess();
return result;
}
async userLogout(pobj, actionBody) {
console.log(actionBody.userpin);
......@@ -110,10 +110,17 @@ class UtilsAuthSve extends AppServiceBase {
return system.getResult(null, "actionBody.userpin can not be empty !");
}
var cacheManager = system.getObject("db.common.cacheManager");
var a = await cacheManager["AppUserPinByLoginVcodeCache"].invalidate(actionBody.userpin);
var b = await cacheManager["AppUserPinByLoginPwdCache"].invalidate(actionBody.userpin);
var c=actionBody.userpin;
return system.getResultSuccess({a,b,c});
var userinfo = await this.cacheManager["AppUserPinByLoginPwdCache"].cache(actionBody.userpin, pobj, system.exTime);
if(userinfo.data){
pobj.actionBody.userName=userinfo.data.channel_username;
}else{
return system.getResultSuccess();
}
await cacheManager["AppUserPinByLoginVcodeCache"].invalidate(actionBody.userpin);
await cacheManager["AppUserPinByLoginPwdCache"].invalidate(actionBody.userpin);
var applogout=await this.restPostUrl(pobj, this.centerAppUrl + "auth/accessAuth/logout");
return applogout;
}
}
......
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