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
f3256419
Commit
f3256419
authored
May 29, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
深度拷贝对象
parent
99cd7f0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
center-channel/app/base/utils/aliyunClient.js
+17
-14
No files found.
center-channel/app/base/utils/aliyunClient.js
View file @
f3256419
...
...
@@ -30,10 +30,11 @@ class aliyunClient {
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
try
{
var
reqAliclient
=
{
...
this
.
aliclient
};
if
(
obj
.
apiVersion
)
{
this
.
a
liclient
.
apiVersion
=
obj
.
apiVersion
;
reqA
liclient
.
apiVersion
=
obj
.
apiVersion
;
}
var
res
=
await
this
.
a
liclient
.
request
(
action
,
reqbody
,
{
var
res
=
await
reqA
liclient
.
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
...
...
@@ -69,46 +70,48 @@ class aliyunClient {
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
var
rpcParam
=
obj
.
rpcParam
;
var
reqAliclient
=
{
...
this
.
aliclient
};
if
(
rpcParam
.
accessKeyId
)
{
this
.
a
liclient
.
accessKeyId
=
rpcParam
.
accessKeyId
;
reqA
liclient
.
accessKeyId
=
rpcParam
.
accessKeyId
;
}
if
(
rpcParam
.
accessKeySecret
)
{
this
.
a
liclient
.
accessKeySecret
=
rpcParam
.
accessKeySecret
;
reqA
liclient
.
accessKeySecret
=
rpcParam
.
accessKeySecret
;
}
if
(
rpcParam
.
endpoint
)
{
this
.
a
liclient
.
endpoint
=
rpcParam
.
endpoint
;
reqA
liclient
.
endpoint
=
rpcParam
.
endpoint
;
}
if
(
rpcParam
.
apiVersion
)
{
this
.
a
liclient
.
apiVersion
=
rpcParam
.
apiVersion
;
reqA
liclient
.
apiVersion
=
rpcParam
.
apiVersion
;
}
var
res
=
await
this
.
a
liclient
.
request
(
action
,
reqbody
,
{
var
res
=
await
reqA
liclient
.
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
});
console
.
log
(
action
,
"action..........."
);
console
.
log
(
reqbody
,
"reqbody..........."
);
console
.
log
(
action
,
"action..........."
);
console
.
log
(
reqbody
,
"reqbody..........."
);
return
system
.
getResultSuccess
(
res
);
}
async
reqCustomByPost
(
obj
,
cbk
)
{
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
var
rpcParam
=
obj
.
rpcParam
;
var
reqAliclient
=
{
...
this
.
aliclient
};
if
(
rpcParam
.
accessKeyId
)
{
this
.
a
liclient
.
accessKeyId
=
rpcParam
.
accessKeyId
;
reqA
liclient
.
accessKeyId
=
rpcParam
.
accessKeyId
;
}
if
(
rpcParam
.
accessKeySecret
)
{
this
.
a
liclient
.
accessKeySecret
=
rpcParam
.
accessKeySecret
;
reqA
liclient
.
accessKeySecret
=
rpcParam
.
accessKeySecret
;
}
if
(
rpcParam
.
endpoint
)
{
this
.
a
liclient
.
endpoint
=
rpcParam
.
endpoint
;
reqA
liclient
.
endpoint
=
rpcParam
.
endpoint
;
}
if
(
rpcParam
.
apiVersion
)
{
this
.
a
liclient
.
apiVersion
=
rpcParam
.
apiVersion
;
reqA
liclient
.
apiVersion
=
rpcParam
.
apiVersion
;
}
var
res
=
await
this
.
a
liclient
.
request
(
action
,
reqbody
,
{
var
res
=
await
reqA
liclient
.
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
...
...
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