...
|
...
|
@@ -22,26 +22,33 @@ class Yohobuy |
|
|
// const API_URL2 = 'http://api.open.yohobuy.com/';
|
|
|
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
|
|
|
const API_URL = 'http://apih5.yoho.cn/';
|
|
|
const API_URL2 = 'http://apih5.yoho.cn/';
|
|
|
const SERVICE_URL = 'http://serviceh5.yoho.cn/';
|
|
|
const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
|
|
// /* 测试环境 */
|
|
|
// const API_URL = 'http://testapi.yoho.cn:28078/';
|
|
|
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
// const API_OLD = 'http://test2.open.yohobuy.com/';
|
|
|
|
|
|
// /* 预览环境 */
|
|
|
// const API_URL = 'http://preapi.yoho.cn/';
|
|
|
// const API_URL2 = 'http://preapi.yoho.cn/';
|
|
|
// const API_URL = 'http://apih5.yoho.cn/';
|
|
|
// const API_URL2 = 'http://apih5.yoho.cn/';
|
|
|
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
// const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
|
|
// /* 测试环境 */
|
|
|
// const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关
|
|
|
const API_URL = 'http://testapi.yoho.cn:28078/';
|
|
|
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
|
|
|
const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
const API_OLD = 'http://test2.open.yohobuy.com/';
|
|
|
|
|
|
/* 预览环境 */
|
|
|
// const API_URL = 'http://preapi.yoho.cn/';
|
|
|
// const API_URL2 = 'http://preapi.yoho.cn/';
|
|
|
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
// const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
|
|
/* PC重构地址 */
|
|
|
// const API_URL = 'http://test.open.yohobuy.com/';
|
|
|
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
// const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
|
|
/**
|
|
|
* 私钥列表
|
|
|
*
|
...
|
...
|
@@ -51,6 +58,7 @@ class Yohobuy |
|
|
'android' => 'fd4ad5fcfa0de589ef238c0e7331b585',
|
|
|
'iphone' => 'a85bb0674e08986c6b115d5e3a4884fa',
|
|
|
'ipad' => 'ad9fcda2e679cf9229e37feae2cdcf80',
|
|
|
'web' => '0ed29744ed318fd28d2c07985d3ba633',
|
|
|
);
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -64,8 +72,12 @@ class Yohobuy |
|
|
}
|
|
|
// 苹果IPAD
|
|
|
elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
|
|
|
|
|
|
return 'ipad';
|
|
|
}
|
|
|
elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) {
|
|
|
return 'android';
|
|
|
}
|
|
|
// 其它
|
|
|
else {
|
|
|
return 'android';
|
...
|
...
|
@@ -150,7 +162,6 @@ class Yohobuy |
|
|
if (!empty($data)) {
|
|
|
$url = self::httpBuildQuery($url, $data);
|
|
|
}
|
|
|
|
|
|
/* 开启缓存的情况 */
|
|
|
if ($cache && USE_CACHE) {
|
|
|
// 先尝试获取一级缓存(master), 有数据则直接返回.
|
...
|
...
|
@@ -168,7 +179,7 @@ class Yohobuy |
|
|
if (!$returnJson && !empty($result)) {
|
|
|
$result = json_decode($result, true);
|
|
|
}
|
|
|
|
|
|
|
|
|
curl_close($ch);
|
|
|
$data = array();
|
|
|
|
...
|
...
|
@@ -216,7 +227,7 @@ class Yohobuy |
|
|
}
|
|
|
curl_setopt($ch, CURLOPT_COOKIE, implode(';', $cookie_str));
|
|
|
}
|
|
|
|
|
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 YOHOWEB');
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
curl_setopt($ch, CURLOPT_POST, true);
|
|
|
// 销毁私钥参数
|
...
|
...
|
|