Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
5841a2f7
Commit
5841a2f7
authored
Mar 19, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
2b8fa150
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
58 deletions
+49
-58
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
+48
-57
igirl-channel-gateway/app/config/routes/api.js
+1
-1
No files found.
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
5841a2f7
...
@@ -16,24 +16,6 @@ class UtilsNeedSve extends AppServiceBase {
...
@@ -16,24 +16,6 @@ class UtilsNeedSve extends AppServiceBase {
}
}
async
getToken
()
{
var
self
=
this
;
var
reqTokenUrl
=
this
.
channelApiUrl
+
"/auth/accessAuth/getToken"
;
var
reqParam
=
self
.
appInfo
[
"aliyuntmtransfer"
];
if
(
!
reqParam
.
appkey
||
!
reqParam
.
secret
)
{
return
system
.
getResult
(
null
,
"reqType类型有误,请求失败"
);
}
var
rtn
=
await
this
.
execlient
.
execPost
(
reqParam
,
reqTokenUrl
);
if
(
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"获取token失败"
);
}
var
tokenResult
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
tokenResult
.
status
==
0
)
{
tokenResult
.
data
.
secret
=
reqParam
.
secret
;
}
return
tokenResult
;
}
async
getCenterToken
()
{
async
getCenterToken
()
{
var
self
=
this
;
var
self
=
this
;
var
reqTokenUrl
=
this
.
centerChannelUrl
+
"/web/auth/accessAuth/getAppTokenByAppKey"
;
var
reqTokenUrl
=
this
.
centerChannelUrl
+
"/web/auth/accessAuth/getAppTokenByAppKey"
;
...
@@ -76,46 +58,55 @@ class UtilsNeedSve extends AppServiceBase {
...
@@ -76,46 +58,55 @@ class UtilsNeedSve extends AppServiceBase {
"errorCode"
:
"ok"
"errorCode"
:
"ok"
};
};
}
}
var
userpin
=
""
;
if
(
pobj
.
mobile
)
{
// //获取用户userpin
//获取用户userpin
// var userpin = "";
var
userparam
=
{
// pobj.actionType = "getLoginByUserName";
actionType
:
"getLoginByUserName"
,
// pobj.actionBody.channelUserId = actionBody.channelUserId;//渠道用户id,没有则用手机号
actionBody
:
{
// pobj.actionBody.mobile = userMoblie;//用户手机号
"channelUserId"
:
pobj
.
mobile
,
// var url = settings.centerChannelUrl() + "/web/auth/accessAuth/springBoard";
"mobile"
:
pobj
.
mobile
,
// var userpinResult = await this.execlient.execPostTK(pobj, url, token);
"userName"
:
pobj
.
mobile
// if (!userpinResult || !userpinResult.stdout) {
}
// return system.getResult(null, userpinResult.msg);
};
// }
// pobj.actionBody.channelUserId = pobj.mobile;//渠道用户id,没有则用手机号
// var userpinResultTmp = JSON.parse(userpinResult.stdout);
// pobj.actionBody.mobile = pobj.mobile;//用户手机号
// if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) {
var
url
=
settings
.
centerChannelUrl
()
+
"/web/auth/accessAuth/springBoard"
;
// return system.getResultFail(-99, "获取userpin失败");
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
// }
if
(
userpinResultTmp
.
status
!=
0
&&
userpinResultTmp
.
status
!=
2060
)
{
// userpin = userpinResultTmp.data.userpin;
return
system
.
getResultFail
(
-
99
,
"获取userpin失败"
);
// if (!userpin) {
}
// return system.getResultFail(-88, "获取userpin失败!!");
userpin
=
userpinResultTmp
.
data
.
userpin
;
// }
if
(
!
userpin
)
{
return
system
.
getResultFail
(
-
88
,
"获取userpin失败!!"
);
//带userpin请求
}
// url = settings.centerChannelUrl() + "web/opaction/order/springBoard";
}
// pobj.actionType = "getOrderDeliveryFlowInfo";
//带userpin请求
// var rtn = await this.execlient.execDataPostByTokenUserPin(pobj, url, token, userpin);
url
=
settings
.
centerChannelUrl
()
+
"/web/opreceive/need/springBoard"
;
// if (!rtn || !rtn.stdout) {
var
token
=
tokenInfo
.
data
.
token
;
// return system.getResult(null, "execPost is empty");
var
rtn
=
null
;
// }
// var result = JSON.parse(rtn.stdout);
var
url
=
settings
.
centerChannelUrl
()
+
"/web/opreceive/need/springBoard"
;
var
rtn
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
tokenInfo
.
data
.
token
);
var
self
=
this
;
var
self
=
this
;
return
{
if
(
userpin
)
{
"requestId"
:
self
.
getUUID
(),
rtn
=
await
self
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
"success"
:
true
,
}
else
{
"errorMsg"
:
""
,
rtn
=
await
self
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
"errorCode"
:
"ok"
return
rtn
;
};
}
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost is empty"
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
// var url = settings.centerChannelUrl() + "/web/opreceive/need/springBoard";
// var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
// var self = this;
// return {
// "requestId": self.getUUID(),
// "success": true,
// "errorMsg": "",
// "errorCode": "ok"
// };
}
}
}
}
...
...
igirl-channel-gateway/app/config/routes/api.js
View file @
5841a2f7
...
@@ -22,7 +22,7 @@ module.exports = function (app) {
...
@@ -22,7 +22,7 @@ module.exports = function (app) {
app
.
use
(
'/api/ali/esp/intention/submit'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/api/ali/esp/intention/submit'
,
async
function
(
req
,
res
)
{
try
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
req
.
body
.
action_type
=
"submit
Solution
"
;
req
.
body
.
action_type
=
"submit
Need
"
;
var
result
=
await
utilsNeedSve
.
reqcenterchannel
(
req
.
body
,
client_ip
);
var
result
=
await
utilsNeedSve
.
reqcenterchannel
(
req
.
body
,
client_ip
);
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"回调处理订单结果:,method="
+
req
.
body
.
trxcode
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment