Commit c8be87bc by 宋毅

tj

parent 94f6e74c
......@@ -4,6 +4,7 @@ class AccessAuthAPI extends APIBase {
constructor() {
super();
this.opPlatformUtils = system.getObject("util.businessManager.opPlatformUtils");
this.toolSve = system.getObject("service.trademark.toolSve");
}
/**
* 接口跳转-POST请求
......@@ -40,6 +41,11 @@ class AccessAuthAPI extends APIBase {
var opResult = system.getResult(null, "req Failure");
var userpin = this.getUUID();
action_body.appInfo = req.app;
var opStr = action_body.userName || action_body.mobile;
var encryptStrResult = await this.toolSve.encryptStr(req.app, opStr);
if(encryptStrResult.status==0){
encryptStrResult.data= encodeURIComponent(encryptStrResult.data);
}
switch (action_type) {
// sy
case "test"://测试
......@@ -52,27 +58,27 @@ class AccessAuthAPI extends APIBase {
}
break;
case "loginUserByChannelUserId"://????
opResult = await this.opPlatformUtils.loginUserByChannelUserId(action_body, action_process, userpin, req);
opResult = await this.opPlatformUtils.getReqUserPinByChannelUserId(action_body, userpin);
if (opResult.status == 0) {
return system.getResultSuccess({ userpin: userpin })
return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: actionBody.channelUserId })
}
break;
case "userPinByLgoin":
opResult = await this.opPlatformUtils.getReqUserPinByLgoin(action_body, userpin);
if (opResult.status == 0) {
return system.getResultSuccess({ userpin: userpin })
return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr })
}
break;
case "userPinByLgoinVcode":
opResult = await this.opPlatformUtils.getReqUserPinByLgoinVcode(action_body, userpin, "login");
if (opResult.status == 0) {
return system.getResultSuccess({ userpin: userpin })
return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr })
}
break;
case "userPinByRegister":
opResult = await this.opPlatformUtils.getReqUserPinByLgoinVcode(action_body, userpin, "reg");
if (opResult.status == 0) {
return system.getResultSuccess({ userpin: userpin })
return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr })
}
break;
default:
......
......@@ -25,10 +25,10 @@ class AppUserPinByLoginPwdCache extends CacheBase {
}//值为2010为用户名或密码错误
var userInfo = await this.appuserDao.getItemByUUserId(actionBody.userName, actionBody.appInfo.id);
if (!userInfo) {
return system.getResult(null, "user to item is empty !");
return system.getResultFail(system.noUserFail, "user to item is empty !");
}
if (userInfo.isEnabled != 1) {
return system.getResult(null, "user to item is Disable !");
return system.getResultFail(system.userDisable, "user to item is Disable !");
}
return system.getResultSuccess(userInfo);
}
......
......@@ -319,4 +319,9 @@ System.getAppInfoFail = 1130;
//已经存在信息
System.existData = 1400;
//获取访问token失败
System.noUserFail = 2070;
//获取访问token失败
System.userDisable = 2080;
module.exports = System;
\ No newline at end of file
......@@ -48,10 +48,12 @@
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,2010为账户或密码错误,2060为重复登录,否则失败
"status": 0,// 0为成功,2010为账户或密码错误,2060为重复登录,2070为帐号不存在,2080为帐号禁用,否则失败
"msg": "success",
"data": {
"userpin": "230ecdf3333944ff834f56fba10a02aa" //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
"userpin": "230ecdf3333944ff834f56fba10a02aa", //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
"channelUserId":"",
"userName":""
},
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
......@@ -79,7 +81,9 @@
"status": 0,// 0为成功,2030为验证码错误,2060为重复登录,否则失败
"msg": "success",
"data": {
"userpin": "230ecdf3333944ff834f56fba10a02aa" //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
"userpin": "230ecdf3333944ff834f56fba10a02aa", //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
"channelUserId":"",
"userName":""
},
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
......@@ -108,7 +112,9 @@
"status": 0,// 0为成功,2030为验证码错误,2060为重复登录,否则失败
"msg": "success",
"data": {
"userpin": "230ecdf3333944ff834f56fba10a02aa" //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
"userpin": "230ecdf3333944ff834f56fba10a02aa", //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
"channelUserId":"",
"userName":""
},
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
......
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