Commit 4c12fed5 by 王栋源

wdy

parent fd8e6862
...@@ -142,12 +142,13 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -142,12 +142,13 @@ class UtilsNeedSve extends AppServiceBase {
} }
var tokenInfo = await this.getCenterToken(); var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return { // return {
"requestId": self.getUUID(), // "requestId": self.getUUID(),
"success": true, // "success": true,
"errorMsg": "", // "errorMsg": "",
"errorCode": "ok" // "errorCode": "ok"
}; // };
return { "message": "success", "data": {}, "code": 200 }
} }
var userpin = ""; var userpin = "";
if (pobj.phone) { if (pobj.phone) {
...@@ -166,21 +167,23 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -166,21 +167,23 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard"; var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) { if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) {
return { return { "message": "网络错误", "data": {}, "code": -102 }
"requestId": self.getUUID(), // return {
"success": false, // "requestId": self.getUUID(),
"errorMsg": "网络错误", // "success": false,
"errorCode": "ok" // "errorMsg": "网络错误",
}; // "errorCode": "ok"
// };
} }
userpin = userpinResultTmp.data.userpin; userpin = userpinResultTmp.data.userpin;
if (!userpin) { if (!userpin) {
return { return { "message": "网络错误", "data": {}, "code": -102 }
"requestId": self.getUUID(), // return {
"success": false, // "requestId": self.getUUID(),
"errorMsg": "网络错误", // "success": false,
"errorCode": "ok" // "errorMsg": "网络错误",
}; // "errorCode": "ok"
// };
} }
} }
//带userpin请求 //带userpin请求
...@@ -188,28 +191,31 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -188,28 +191,31 @@ class UtilsNeedSve extends AppServiceBase {
var token = tokenInfo.data.token; var token = tokenInfo.data.token;
var rtn = rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin); var rtn = rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return { return { "message": "网络错误", "data": {}, "code": -102 }
"requestId": self.getUUID(), // return {
"success": false, // "requestId": self.getUUID(),
"errorMsg": "网络错误", // "success": false,
"errorCode": "ok" // "errorMsg": "网络错误",
}; // "errorCode": "ok"
// };
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status == 0) { if (result.status == 0) {
return { return { "message": "true", "data": {}, "code": 200 }
"requestId": result.requestId, // return {
"success": true, // "requestId": result.requestId,
"errorMsg": "", // "success": true,
"errorCode": "ok" // "errorMsg": "",
}; // "errorCode": "ok"
// };
} else { } else {
return { return { "message": result.msg, "data": {}, "code": -102 }
"requestId": result.requestId, // return {
"success": false, // "requestId": result.requestId,
"errorMsg": result.msg, // "success": false,
"errorCode": "ok" // "errorMsg": result.msg,
}; // "errorCode": "ok"
// };
} }
} }
...@@ -218,7 +224,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -218,7 +224,7 @@ class UtilsNeedSve extends AppServiceBase {
"actionType": pobj.action_type, "actionType": pobj.action_type,
"actionBody": pobj "actionBody": pobj
} }
var self=this; var self = this;
var tokenInfo = await this.getCenterToken(); var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return { return {
......
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