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
050558a8
Commit
050558a8
authored
Nov 10, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
百度上线
parent
e659e752
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
center-channel/app/base/service/impl/common/signSve.js
+3
-6
center-channel/app/base/utils/baiduClient.js
+8
-5
No files found.
center-channel/app/base/service/impl/common/signSve.js
View file @
050558a8
...
...
@@ -116,12 +116,9 @@ module.exports = SignService;
// var task = new SignService();
// var obj = {
// "intentionBizId": "TRE-nmnHtEoTjeEtest",
// "phone": "13126673246",
// "userName": "",
// "description": "111111",
// "area": "BEIJING",
// "consultType": "EDI"
// "intentionBizId": "TRE-vLTWoPv99nfceshishuju2",
// "description": "测试用户关闭2",
// "intentionStatus": 5
// };
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(d=>{
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!");
...
...
center-channel/app/base/utils/baiduClient.js
View file @
050558a8
...
...
@@ -13,17 +13,20 @@ class baiduClient {
//2020 1027 laolan 调用百度网关
async
baiduPost
(
path
,
actionBody
)
{
console
.
log
(
'actionBody++'
,
actionBody
)
let
domain
=
"https://gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
;
// let domain = "https://gwgp-mwnn9gk4o4e.i.bdcloudapi.com";//开发
let
domain
=
"https://gwgp-nbzljnwusrw.i.bdcloudapi.com"
;
//线上
let
url
=
domain
+
path
;
let
version
=
"bce-auth-v1"
;
let
accessKey
=
"ed0f5c4c7c2d4e87aa335d9b07bf9bd4"
;
let
secretKey
=
"f600c4e91f6d43998d637401e6e34ef9"
;
// let accessKey = "ed0f5c4c7c2d4e87aa335d9b07bf9bd4";
// let secretKey = "f600c4e91f6d43998d637401e6e34ef9";
let
accessKey
=
"0e5abf33ef07457f8dbd779287747c0c"
;
let
secretKey
=
"9d86f04a85db4cdfa95ba8ad28009188"
;
let
timestamp
=
new
Date
().
toISOString
()
let
site
=
timestamp
.
lastIndexOf
(
"."
);
timestamp
=
timestamp
.
substring
(
0
,
site
)
+
"Z"
let
signedHeaders
=
"host"
;
let
extime
=
1800
;
let
canonicalHeaders
=
"host:gwgp-
mwnn9gk4o4e
.i.bdcloudapi.com"
let
canonicalHeaders
=
"host:gwgp-
nbzljnwusrw
.i.bdcloudapi.com"
//中间结果1:规范化请求和前缀字符串
let
canonicalRequest
=
"POST"
+
"
\
n"
+
path
+
"
\
n"
+
"
\
n"
+
canonicalHeaders
;
//authStringPrefix(前缀字符串,由除sk字段外的签名信息生成)
...
...
@@ -64,7 +67,7 @@ class baiduClient {
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
method
:
'POST'
,
// set the http method, default is GET
headers
:
{
host
:
"gwgp-
mwnn9gk4o4e
.i.bdcloudapi.com"
host
:
"gwgp-
nbzljnwusrw
.i.bdcloudapi.com"
},
// set the http request headers
});
console
.
log
(
'baidu++++res+++'
,
res
)
...
...
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