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
fb8972d5
Commit
fb8972d5
authored
Mar 17, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
a870e954
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
1 deletions
+78
-1
igirl-channel-gateway/app/base/api/impl/action/intentionapi.js
+70
-0
igirl-channel-gateway/app/config/settings.js
+8
-1
No files found.
igirl-channel-gateway/app/base/api/impl/action/intentionapi.js
0 → 100644
View file @
fb8972d5
const
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
APIBase
=
require
(
"../../api.base"
);
class
TradetransferAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
channelApiUrl
=
settings
.
channelApiUrl
();
this
.
appInfo
=
{
aliyuntmtransfer
:
{
appkey
:
settings
.
appKey
,
secret
:
settings
.
secret
}
};
}
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
;
}
/**
* 接口跳转-POST请求
* actionProcess 执行的流程
* actionType 执行的类型
* actionBody 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess参数不能为空"
);
}
if
(
!
pobj
.
action_type
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
console
.
log
(
pobj
);
// var result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
// return result;
}
// 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
;
igirl-channel-gateway/app/config/settings.js
View file @
fb8972d5
...
@@ -33,11 +33,18 @@ var settings = {
...
@@ -33,11 +33,18 @@ var settings = {
},
},
channelApiUrl
:
function
()
{
channelApiUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.
61
:4003"
;
return
"http://192.168.18.
34
:4003"
;
}
else
{
}
else
{
return
"http://zc-channel-service"
;
return
"http://zc-channel-service"
;
}
}
},
},
centerChannelUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://gsb.qifu.gongsibao.com:4012/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"http://gsb.qifu.gongsibao.com:4012/"
;
}
},
apiconfig
:
{
apiconfig
:
{
opLogUrl
:
function
()
{
opLogUrl
:
function
()
{
...
...
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