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
8957a52f
Commit
8957a52f
authored
Apr 03, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
d2f2642f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
63 deletions
+69
-63
igirl-channel-gateway/app/base/api/impl/action/intentionapi.js
+27
-21
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
+42
-42
No files found.
igirl-channel-gateway/app/base/api/impl/action/intentionapi.js
View file @
8957a52f
...
@@ -7,6 +7,7 @@ class TradetransferAPI extends APIBase {
...
@@ -7,6 +7,7 @@ class TradetransferAPI extends APIBase {
super
();
super
();
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
channelApiUrl
=
settings
.
channelApiUrl
();
this
.
channelApiUrl
=
settings
.
channelApiUrl
();
this
.
utilsNeedSve
=
system
.
getObject
(
"service.utilsSve.utilsNeedSve"
);
}
}
/**
/**
...
@@ -18,33 +19,38 @@ class TradetransferAPI extends APIBase {
...
@@ -18,33 +19,38 @@ class TradetransferAPI extends APIBase {
async
springBoard
(
pobj
,
qobj
,
req
)
{
async
springBoard
(
pobj
,
qobj
,
req
)
{
console
.
log
(
pobj
);
console
.
log
(
pobj
);
console
.
log
(
req
);
console
.
log
(
req
);
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess参数不能为空"
);
}
if
(
!
pobj
.
action_type
)
{
if
(
!
pobj
.
action_type
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
}
console
.
log
(
pobj
);
console
.
log
(
pobj
);
// var result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
action_type
);
// return result;
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"submitNeed"
:
//提交需求
opResult
=
await
this
.
utilsNeedSve
.
reqcenterchannel
(
pobj
);
break
;
case
"needClose"
:
//关闭需求
opResult
=
await
this
.
utilsNeedSve
.
reqcenterchannel
(
pobj
);
break
;
case
"receiveFeedback"
:
//接收方案反馈信息
opResult
=
await
this
.
utilsNeedSve
.
reqcenterchannel
(
pobj
);
break
;
case
"paySuccess"
:
//支付回调
opResult
=
await
this
.
utilsNeedSve
.
paySuccess
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
// async opActionProcess(action_process, action_type, action_body, req) {
// var opResult = null;
// settings.channelApiUrl+""
// var sobj = {
// "actionProcess": "aliyuntmtransfer",
// "actionType": "aliclient",
// "sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI",
// "isUser": "yes",
// "actionBody": action_body
// }
// var tokenInfo = await this.getToken();
// var url = this.centerChannelUrl + "/action/tradetransfer/createtransfer";
// var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
// return rtn;
// }
}
}
module
.
exports
=
TradetransferAPI
;
module
.
exports
=
TradetransferAPI
;
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
8957a52f
...
@@ -142,13 +142,13 @@ class UtilsNeedSve extends AppServiceBase {
...
@@ -142,13 +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
}
//
return { "message": "success", "data": {}, "code": 200 }
}
}
var
userpin
=
""
;
var
userpin
=
""
;
if
(
pobj
.
phone
)
{
if
(
pobj
.
phone
)
{
...
@@ -167,23 +167,23 @@ class UtilsNeedSve extends AppServiceBase {
...
@@ -167,23 +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
{
"message"
:
"网络错误"
,
"data"
:
{},
"code"
:
-
102
}
//
return { "message": "网络错误", "data": {}, "code": -102 }
//
return {
return
{
//
"requestId": self.getUUID(),
"requestId"
:
self
.
getUUID
(),
//
"success": false,
"success"
:
false
,
//
"errorMsg": "网络错误",
"errorMsg"
:
"网络错误"
,
//
"errorCode": "ok"
"errorCode"
:
"ok"
//
};
};
}
}
userpin
=
userpinResultTmp
.
data
.
userpin
;
userpin
=
userpinResultTmp
.
data
.
userpin
;
if
(
!
userpin
)
{
if
(
!
userpin
)
{
return
{
"message"
:
"网络错误"
,
"data"
:
{},
"code"
:
-
102
}
//
return { "message": "网络错误", "data": {}, "code": -102 }
//
return {
return
{
//
"requestId": self.getUUID(),
"requestId"
:
self
.
getUUID
(),
//
"success": false,
"success"
:
false
,
//
"errorMsg": "网络错误",
"errorMsg"
:
"网络错误"
,
//
"errorCode": "ok"
"errorCode"
:
"ok"
//
};
};
}
}
}
}
//带userpin请求
//带userpin请求
...
@@ -191,31 +191,31 @@ class UtilsNeedSve extends AppServiceBase {
...
@@ -191,31 +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
{
"message"
:
"网络错误"
,
"data"
:
{},
"code"
:
-
102
}
//
return { "message": "网络错误", "data": {}, "code": -102 }
//
return {
return
{
//
"requestId": self.getUUID(),
"requestId"
:
self
.
getUUID
(),
//
"success": false,
"success"
:
false
,
//
"errorMsg": "网络错误",
"errorMsg"
:
"网络错误"
,
//
"errorCode": "ok"
"errorCode"
:
"ok"
//
};
};
}
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
if
(
result
.
status
==
0
)
{
return
{
"message"
:
"true"
,
"data"
:
{},
"code"
:
200
}
//
return { "message": "true", "data": {}, "code": 200 }
//
return {
return
{
//
"requestId": result.requestId,
"requestId"
:
result
.
requestId
,
//
"success": true,
"success"
:
true
,
//
"errorMsg": "",
"errorMsg"
:
""
,
//
"errorCode": "ok"
"errorCode"
:
"ok"
//
};
};
}
else
{
}
else
{
return
{
"message"
:
result
.
msg
,
"data"
:
{},
"code"
:
-
102
}
//
return { "message": result.msg, "data": {}, "code": -102 }
//
return {
return
{
//
"requestId": result.requestId,
"requestId"
:
result
.
requestId
,
//
"success": false,
"success"
:
false
,
//
"errorMsg": result.msg,
"errorMsg"
:
result
.
msg
,
//
"errorCode": "ok"
"errorCode"
:
"ok"
//
};
};
}
}
}
}
...
...
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