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