Authored by 于良

接口请求参数增加client_type和对应的key

@@ -52,7 +52,7 @@ class DetailData @@ -52,7 +52,7 @@ class DetailData
52 $param = Yohobuy::param(); 52 $param = Yohobuy::param();
53 $param['article_id'] = $id; 53 $param['article_id'] = $id;
54 $param['client_type'] = $clientType; 54 $param['client_type'] = $clientType;
55 - $param['private_key'] = Yohobuy::$privateKeyList['h5']; 55 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
56 $param['client_secret'] = Sign::getSign($param); 56 $param['client_secret'] = Sign::getSign($param);
57 $result = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getArticle', $param); 57 $result = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getArticle', $param);
58 $article = $result['data']; 58 $article = $result['data'];
@@ -73,7 +73,7 @@ class DetailData @@ -73,7 +73,7 @@ class DetailData
73 $param = Yohobuy::param(); 73 $param = Yohobuy::param();
74 $param['article_id'] = $id; 74 $param['article_id'] = $id;
75 $param['client_type'] = $clientType; 75 $param['client_type'] = $clientType;
76 - $param['private_key'] = Yohobuy::$privateKeyList['h5']; 76 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
77 $param['client_secret'] = Sign::getSign($param); 77 $param['client_secret'] = Sign::getSign($param);
78 $result = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getArticle', $param); 78 $result = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getArticle', $param);
79 $article = $result['data']; 79 $article = $result['data'];
@@ -100,7 +100,7 @@ class DetailData @@ -100,7 +100,7 @@ class DetailData
100 $param = Yohobuy::param(); 100 $param = Yohobuy::param();
101 $param['article_id'] = $id; 101 $param['article_id'] = $id;
102 $param['client_type'] = $clientType; 102 $param['client_type'] = $clientType;
103 - $param['private_key'] = Yohobuy::$privateKeyList['h5']; 103 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
104 $param['client_secret'] = Sign::getSign($param); 104 $param['client_secret'] = Sign::getSign($param);
105 $urlList['getArticleContent'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getArticleContent', $param); 105 $urlList['getArticleContent'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getArticleContent', $param);
106 106
@@ -108,7 +108,7 @@ class DetailData @@ -108,7 +108,7 @@ class DetailData
108 $param = Yohobuy::param(); 108 $param = Yohobuy::param();
109 $param['article_id'] = $id; 109 $param['article_id'] = $id;
110 $param['client_type'] = $clientType; 110 $param['client_type'] = $clientType;
111 - $param['private_key'] = Yohobuy::$privateKeyList['h5']; 111 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
112 $param['client_secret'] = Sign::getSign($param); 112 $param['client_secret'] = Sign::getSign($param);
113 $urlList['getBrand'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getBrand', $param); 113 $urlList['getBrand'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getBrand', $param);
114 114
@@ -120,7 +120,7 @@ class DetailData @@ -120,7 +120,7 @@ class DetailData
120 $param['tags'] = $article['tag']; 120 $param['tags'] = $article['tag'];
121 $param['offset'] = 0; 121 $param['offset'] = 0;
122 $param['limit'] = 3; 122 $param['limit'] = 3;
123 - $param['private_key'] = Yohobuy::$privateKeyList['h5']; 123 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
124 $param['client_secret'] = Sign::getSign($param); 124 $param['client_secret'] = Sign::getSign($param);
125 $urlList['getOtherArticle'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getOtherArticle', $param); 125 $urlList['getOtherArticle'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE . 'getOtherArticle', $param);
126 } 126 }
@@ -145,6 +145,8 @@ class PlusstarData @@ -145,6 +145,8 @@ class PlusstarData
145 $param = Yohobuy::param(); 145 $param = Yohobuy::param();
146 $param['uid'] = $uid; 146 $param['uid'] = $uid;
147 $param['brandId'] = $cached['getBrandInfo']['data']['brand_id']; 147 $param['brandId'] = $cached['getBrandInfo']['data']['brand_id'];
  148 + $param['client_type'] = $clientType;
  149 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
148 $param['client_secret'] = Sign::getSign($param); 150 $param['client_secret'] = Sign::getSign($param);
149 $getUidBrandFav = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_FAVORITE . 'getUidBrandFav', $param); 151 $getUidBrandFav = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_FAVORITE . 'getUidBrandFav', $param);
150 // file_put_contents('../../../../../../Desktop/app/n/getUidBrandFav.txt', var_export($getUidBrandFav, true)); 152 // file_put_contents('../../../../../../Desktop/app/n/getUidBrandFav.txt', var_export($getUidBrandFav, true));
@@ -165,6 +167,8 @@ class PlusstarData @@ -165,6 +167,8 @@ class PlusstarData
165 // 品牌详情信息 167 // 品牌详情信息
166 $param = Yohobuy::param(); 168 $param = Yohobuy::param();
167 $param['id'] = $id; 169 $param['id'] = $id;
  170 + $param['client_type'] = $clientType;
  171 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
168 $param['client_secret'] = Sign::getSign($param); 172 $param['client_secret'] = Sign::getSign($param);
169 $brandInfo = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR_NEW . 'getbrandinfo', $param, 3600); 173 $brandInfo = Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR_NEW . 'getbrandinfo', $param, 3600);
170 // file_put_contents('../../../../../../Desktop/app/n/getbrandinfo.txt', var_export($brandInfo, true)); 174 // file_put_contents('../../../../../../Desktop/app/n/getbrandinfo.txt', var_export($brandInfo, true));
@@ -187,7 +191,7 @@ class PlusstarData @@ -187,7 +191,7 @@ class PlusstarData
187 $param['udid'] = $udid; 191 $param['udid'] = $udid;
188 $param['limit'] = 3; 192 $param['limit'] = 3;
189 $param['client_type'] = $clientType; 193 $param['client_type'] = $clientType;
190 - $param['private_key'] = Yohobuy::$privateKeyList['h5']; 194 + $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
191 $param['client_secret'] = Sign::getSign($param); 195 $param['client_secret'] = Sign::getSign($param);
192 196
193 $article = Yohobuy::get(Yohobuy::SERVICE_URL.self::URI_BRANDINFO_ARTICLE.'getArticleByBrand', $param); 197 $article = Yohobuy::get(Yohobuy::SERVICE_URL.self::URI_BRANDINFO_ARTICLE.'getArticleByBrand', $param);