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
ac2fb22c
Commit
ac2fb22c
authored
Mar 01, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
57521be5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
3 deletions
+80
-3
center-order/app/base/service/impl/dbneed/needinfoSve.js
+3
-3
center-order/app/base/utils/aliyunClient.js
+77
-0
No files found.
center-order/app/base/service/impl/dbneed/needinfoSve.js
View file @
ac2fb22c
...
@@ -39,5 +39,5 @@ class NeedinfoService extends ServiceBase {
...
@@ -39,5 +39,5 @@ class NeedinfoService extends ServiceBase {
}
}
module
.
exports
=
NeedinfoService
;
module
.
exports
=
NeedinfoService
;
var
a
=
new
NeedinfoService
();
// var a=new NeedinfoService();
a
.
needinfo2fq
();
// a.needinfo2fq();
\ No newline at end of file
\ No newline at end of file
center-order/app/base/utils/aliyunClient.js
0 → 100644
View file @
ac2fb22c
const
Client
=
require
(
'aliyun-api-gateway'
).
Client
;
var
RPCClient
=
require
(
'@alicloud/pop-core'
).
RPCClient
;
// const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');//开发
const
client
=
new
Client
(
'203763771'
,
'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu'
);
//线上
class
aliyunClient
{
constructor
()
{
// this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard";
this
.
aliclient
=
new
RPCClient
({
accessKeyId
:
'LTAI4FmyipY1wuLHjLhMWiPa'
,
accessKeySecret
:
'hp4FF18IDCSym1prqzxrAjnnhNH3ju'
,
endpoint
:
'https://trademark.aliyuncs.com'
,
apiVersion
:
'2018-07-24'
});
}
async
post
(
aliReqUrl
,
actionBody
)
{
// var reqParam = {};
// reqParam["ActionProcess"] = "AliTm";
// reqParam["ActionType"] = actionType;
// reqParam["ActionBody"] = actionBody;
// if (!actionBody.reqOnlyCode) {
// actionBody["reqOnlyCode"] = await this.getCreateOrderNum();
// }
var
param
=
{
data
:
actionBody
,
timeout
:
20000
,
headers
:
{
accept
:
'application/json'
}
};
console
.
log
(
JSON
.
stringify
(
param
),
"______________峰擎---阿里云参数_______"
);
var
result
=
await
client
.
post
(
aliReqUrl
,
param
);
console
.
log
(
JSON
.
stringify
(
result
),
"______________峰擎---阿里云返回结果_______"
);
return
result
;
}
//阿里接口
async
reqbyget
(
obj
,
cbk
)
{
var
self
=
this
;
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
return
self
.
aliclient
.
request
(
action
,
reqbody
,
{
timeout
:
3000
,
// default 3000 ms
formatAction
:
true
,
// default true, format the action to Action
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
method
:
'GET'
,
// set the http method, default is GET
headers
:
{},
// set the http request headers
});
}
// async getCreateOrderNum() {
// var createOrderNum = await this.getUidStr(5, 36);//====================订单号生成
// return createOrderNum + "" + Date.now();
// }
// async getUidStr(len, radix) {
// var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
// var uuid = [], i;
// radix = radix || chars.length;
// if (len) {
// for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
// } else {
// var r;
// uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
// uuid[14] = '4';
// for (i = 0; i < 36; i++) {
// if (!uuid[i]) {
// r = 0 | Math.random() * 16;
// uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
// }
// }
// }
// return uuid.join('');
// }
}
module
.
exports
=
aliyunClient
;
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