PHP接口调用修改解决冲突
Showing
2 changed files
with
4 additions
and
2 deletions
@@ -12,7 +12,6 @@ | @@ -12,7 +12,6 @@ | ||
12 | namespace Api; | 12 | namespace Api; |
13 | 13 | ||
14 | use Plugin\Cache; | 14 | use Plugin\Cache; |
15 | - | ||
16 | class Yohobuy | 15 | class Yohobuy |
17 | { | 16 | { |
18 | /* 正式环境 */ | 17 | /* 正式环境 */ |
@@ -66,8 +65,10 @@ class Yohobuy | @@ -66,8 +65,10 @@ class Yohobuy | ||
66 | */ | 65 | */ |
67 | public static function clientType() | 66 | public static function clientType() |
68 | { | 67 | { |
68 | + | ||
69 | if(self::isMobile()) { | 69 | if(self::isMobile()) { |
70 | return 'h5'; | 70 | return 'h5'; |
71 | + | ||
71 | } | 72 | } |
72 | else { | 73 | else { |
73 | return 'web'; | 74 | return 'web'; |
@@ -486,6 +487,7 @@ class Yohobuy | @@ -486,6 +487,7 @@ class Yohobuy | ||
486 | 487 | ||
487 | return $result; | 488 | return $result; |
488 | } | 489 | } |
490 | + | ||
489 | /** | 491 | /** |
490 | * 获取用户User-Agent | 492 | * 获取用户User-Agent |
491 | * @return bool | 493 | * @return bool |
@@ -338,7 +338,7 @@ class Helpers | @@ -338,7 +338,7 @@ class Helpers | ||
338 | $result = array(); | 338 | $result = array(); |
339 | $result['id'] = $articleData['id']; | 339 | $result['id'] = $articleData['id']; |
340 | $result['showTags'] = $showTag; | 340 | $result['showTags'] = $showTag; |
341 | - $result['img'] = self::getImageUrl($articleData['src'], 640, 640); | 341 | + $result['img'] = isset($articleData['src']) ? self::getImageUrl($articleData['src'], 640, 640) : ''; |
342 | $result['url'] = $articleData['url']; //$isApp ? $articleData['url'] : self::url('/info/index', array('id' => $articleData['id']), 'guang'); | 342 | $result['url'] = $articleData['url']; //$isApp ? $articleData['url'] : self::url('/info/index', array('id' => $articleData['id']), 'guang'); |
343 | $result['title'] = $articleData['title']; | 343 | $result['title'] = $articleData['title']; |
344 | $result['text'] = $articleData['intro']; | 344 | $result['text'] = $articleData['intro']; |
-
Please register or login to post a comment