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
cef76931
Commit
cef76931
authored
Nov 06, 2020
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f4a14258
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
44 deletions
+45
-44
center-order/app/base/utils/execClientNew.js
+45
-44
No files found.
center-order/app/base/utils/execClientNew.js
View file @
cef76931
...
@@ -34,53 +34,54 @@ class ExecClientNew {
...
@@ -34,53 +34,54 @@ class ExecClientNew {
}
}
}
}
try
{
try
{
if
(
settings
.
env
===
"localhost"
||
settings
.
env
===
"dev"
)
{
//
if (settings.env === "localhost" || settings.env === "dev") {
var
headers
=
{
//
var headers = {
'Content-type'
:
'application/json'
//
'Content-type': 'application/json'
}
//
}
if
(
headData
)
{
//
if (headData) {
var
headDataKeys
=
Object
.
keys
(
headData
);
//
var headDataKeys = Object.keys(headData);
if
(
headDataKeys
.
length
>
0
)
{
//
if (headDataKeys.length > 0) {
for
(
let
index
=
0
;
index
<
headDataKeys
.
length
;
index
++
)
{
//
for (let index = 0; index < headDataKeys.length; index++) {
const
indexKey
=
headDataKeys
[
index
];
//
const indexKey = headDataKeys[index];
var
headValue
=
headData
[
indexKey
];
//
var headValue = headData[indexKey];
if
(
indexKey
&&
headValue
)
{
//
if (indexKey && headValue) {
headers
[
indexKey
]
=
headValue
;
//
headers[indexKey] = headValue;
}
//
}
}
//
}
}
//
}
}
//
}
axios
.
default
.
timeout
=
timeOut
;
//
axios.default.timeout = timeOut;
let
result
=
await
axios
({
//
let result = await axios({
// headers: {'Content-Type': 'application/x-www-form-urlencoded'},
//
// headers: {'Content-Type': 'application/x-www-form-urlencoded'},
headers
:
headers
,
//
headers: headers,
method
:
'POST'
,
//
method: 'POST',
url
:
url
,
//
url: url,
data
:
JSON
.
stringify
(
params
)
//
data: JSON.stringify(params)
});
//
});
if
(
result
.
status
==
200
)
{
//
if (result.status == 200) {
reqResult
=
system
.
getResultSuccess
(
result
.
data
);
//
reqResult = system.getResultSuccess(result.data);
//
}
else
{
//
} else {
reqResult
=
system
.
getResult
(
null
,
"执行execPostTimeOutByBusiness存在错误"
);
//
reqResult = system.getResult(null, "执行execPostTimeOutByBusiness存在错误");
}
//
}
reqResult
.
requestId
=
requestId
||
uuid
.
v1
();
//
reqResult.requestId = requestId || uuid.v1();
if
(
result
.
headers
)
{
//
if (result.headers) {
delete
result
[
"headers"
];
//
delete result["headers"];
}
//
}
if
(
result
.
request
)
{
//
if (result.request) {
delete
result
[
"request"
];
//
delete result["request"];
}
//
}
if
(
result
.
config
)
{
//
if (result.config) {
delete
result
[
"config"
];
//
delete result["config"];
}
//
}
params
.
reqUrl
=
url
;
//
params.reqUrl = url;
this
.
execLogs
(
execFile
+
"执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果"
,
params
,
params
.
identifyCode
,
reqResult
,
result
);
//
this.execLogs(execFile + "执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果", params, params.identifyCode, reqResult, result);
return
reqResult
;
//
return reqResult;
}
//
}
//方式二
//方式二
rtn
=
await
this
.
execPostTimeOut
(
params
,
url
,
ContentType
,
headData
,
timeOut
);
rtn
=
await
this
.
execPostTimeOut
(
params
,
url
,
ContentType
,
headData
,
timeOut
);
params
.
reqUrl
=
url
;
params
.
reqUrl
=
url
;
console
.
log
(
result
,
'----------------'
)
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
this
.
execLogs
(
execFile
+
"执行execPostTimeOutByBusiness返回的数据为空"
,
params
,
params
.
identifyCode
,
null
,
null
);
this
.
execLogs
(
execFile
+
"执行execPostTimeOutByBusiness返回的数据为空"
,
params
,
params
.
identifyCode
,
null
,
null
);
reqResult
=
system
.
getResult
(
null
,
"execPostTimeOut data is empty"
);
reqResult
=
system
.
getResult
(
null
,
"execPostTimeOut data is empty"
);
...
...
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