Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
8 years ago
Commit
706454512dc87256b101299669ee0a60ca03d542
1 parent
8ab88791
curl code
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
library/Api/Yohobuy.php
library/Api/Yohobuy.php
View file @
7064545
...
...
@@ -212,10 +212,9 @@ class Yohobuy
}
$result
=
curl_exec
(
$ch
);
$httpCode
=
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
);
//如果分流执行失败,则走原来的逻辑
if
(
USE_INTER_FACE_SHUNT
&&
$httpCode
!==
200
)
{
if
(
USE_INTER_FACE_SHUNT
&&
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
)
!==
200
)
{
curl_close
(
$ch
);
return
self
::
_get
(
$urlBack
,
$data
,
$cache
,
$returnJson
,
$timeout
,
$userAgent
,
$useGzip
);
}
...
...
@@ -279,7 +278,6 @@ class Yohobuy
UdpLog
::
debug
(
'call api: '
,
$url
);
$result
=
curl_exec
(
$ch
);
$httpCode
=
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
);
if
(
!
$returnJson
&&
!
empty
(
$result
))
{
$result
=
json_decode
(
$result
,
true
);
}
...
...
@@ -372,12 +370,8 @@ class Yohobuy
}
$result
=
curl_exec
(
$ch
);
$httpCode
=
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
);
UdpLog
::
debug
(
'post api'
,
array
(
'url'
=>
$url
,
'httpCode'
=>
$httpCode
));
//如果分流执行失败,则走原来的逻辑
if
(
USE_INTER_FACE_SHUNT
&&
$httpCode
!==
200
)
{
if
(
USE_INTER_FACE_SHUNT
&&
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
)
!==
200
)
{
curl_close
(
$ch
);
return
self
::
_post
(
$urlBack
,
$data
,
$returnJson
,
$timeout
,
$header
,
$cookie
);
}
...
...
Please
register
or
login
to post a comment