Authored by 郝肖肖

分流url 判断

@@ -155,10 +155,10 @@ class Yohobuy @@ -155,10 +155,10 @@ class Yohobuy
155 $urlBack = $url; 155 $urlBack = $url;
156 156
157 if (USE_INTER_FACE_SHUNT) { 157 if (USE_INTER_FACE_SHUNT) {
158 - if (strpos($url, 'api')) { 158 + if (strpos($url, API_URL)) {
159 $isApi = true; 159 $isApi = true;
160 $url = self::_getUrl($url, $data); 160 $url = self::_getUrl($url, $data);
161 - } else if (strpos($url, 'service')) { 161 + } else if (strpos($url, SERVICE_URL)) {
162 $isService = true; 162 $isService = true;
163 $url = self::_getUrl($url, $data); 163 $url = self::_getUrl($url, $data);
164 } 164 }
@@ -319,10 +319,10 @@ class Yohobuy @@ -319,10 +319,10 @@ class Yohobuy
319 $urlBack = $url; 319 $urlBack = $url;
320 320
321 if (USE_INTER_FACE_SHUNT) { 321 if (USE_INTER_FACE_SHUNT) {
322 - if (strpos($url, 'api')) { 322 + if (strpos($url, API_URL)) {
323 $isApi = true; 323 $isApi = true;
324 $url = self::_getUrl($url, $data); 324 $url = self::_getUrl($url, $data);
325 - } else if (strpos($url, 'service')) { 325 + } else if (strpos($url, SERVICE_URL)) {
326 $isService = true; 326 $isService = true;
327 $url = self::_getUrl($url, $data); 327 $url = self::_getUrl($url, $data);
328 } 328 }
@@ -761,7 +761,7 @@ class Yohobuy @@ -761,7 +761,7 @@ class Yohobuy
761 } 761 }
762 762
763 $paseUrl = parse_url($url); 763 $paseUrl = parse_url($url);
764 - if (strpos($url, 'api')) { 764 + if (strpos($url, API_URL)) {
765 765
766 if (empty($ips['api.yoho.cn'])) { 766 if (empty($ips['api.yoho.cn'])) {
767 return false; 767 return false;
@@ -775,7 +775,7 @@ class Yohobuy @@ -775,7 +775,7 @@ class Yohobuy
775 775
776 $url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/'; 776 $url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/';
777 777
778 - } else if (strpos($url, 'service')) { 778 + } else if (strpos($url, SERVICE_URL)) {
779 779
780 if (empty($ips['service.yoho.cn'])) { 780 if (empty($ips['service.yoho.cn'])) {
781 return false; 781 return false;