...
|
...
|
@@ -43,34 +43,69 @@ class HfController extends AbstractAction |
|
|
* ]
|
|
|
* echo md5(file_get_contents('http://cdn.yoho.cn/app-hotfix/yohobuy/4.0.1/main-4.js')); exit;
|
|
|
*/
|
|
|
public function v1Action()
|
|
|
public function v1Action()
|
|
|
{
|
|
|
$result = array('code' => 200, 'message' => 'Config Success', 'md5' => '', 'data' => array());
|
|
|
|
|
|
// 根据版本号返回补丁文件信息
|
|
|
$clienttype = $this->post('client_type');
|
|
|
$version = $this->post('app_version');
|
|
|
switch ($version) {
|
|
|
// case '4.0.1': // 版本
|
|
|
// $result['data']['url'] = 'http://cdn.yoho.cn/app-hotfix/yohobuy/4.0.1/main-4.js';
|
|
|
// $result['data']['patchv'] = '103';
|
|
|
// $result['data']['filecode'] = md5('f9c03ec39cfb2686d2b778e444fb2306' . 'yohopatch2016');
|
|
|
// $result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
// break;
|
|
|
case '4.0.0': // 版本
|
|
|
$result['data']['url'] = 'http://cdn.yoho.cn/app-hotfix/yohobuy/4.0.0/main2.js';
|
|
|
$result['data']['patchv'] = '102';
|
|
|
$result['data']['filecode'] = md5('dddd71eed2754a53ad843a78587dc1f5' . 'yohopatch2016');
|
|
|
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
break;
|
|
|
default: // 默认
|
|
|
$result['data']['url'] = '';
|
|
|
$result['data']['patchv'] = '';
|
|
|
$result['data']['filecode'] = '';
|
|
|
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$ios = 'ios';
|
|
|
$android = 'android';
|
|
|
|
|
|
// 根据版本号返回补丁文件信息
|
|
|
|
|
|
if (strcasecmp($clienttype, $ios) == 0){
|
|
|
|
|
|
switch ($version) {
|
|
|
// case '4.0.1': // 版本
|
|
|
// $result['data']['url'] = 'http://cdn.yoho.cn/app-hotfix/yohobuy/4.0.1/main-4.js';
|
|
|
// $result['data']['patchv'] = '103';
|
|
|
// $result['data']['filecode'] = md5('f9c03ec39cfb2686d2b778e444fb2306' . 'yohopatch2016');
|
|
|
// $result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
// break;
|
|
|
case '4.0.0': // 版本
|
|
|
$result['data']['url'] = '';
|
|
|
$result['data']['patchv'] = '';
|
|
|
$result['data']['filecode'] = md5('dddd71eed2754a53ad843a78587dc1f5' . 'yohopatch2016');
|
|
|
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
// var_dump('ios 4.0');
|
|
|
break;
|
|
|
default: // 默认
|
|
|
$result['data']['url'] = '';
|
|
|
$result['data']['patchv'] = '';
|
|
|
$result['data']['filecode'] = '';
|
|
|
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
// var_dump('ios 4.1');
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
else if (strcasecmp($clienttype, $android) == 0){
|
|
|
|
|
|
switch ($version) {
|
|
|
case '4.4.0': // 版本
|
|
|
$result['data']['url'] = 'http://cdn.yoho.cn/app-hotfix/yohobuy/a/4.3.0/201605191600.apatch';
|
|
|
$result['data']['patchv'] = '103';
|
|
|
$result['data']['filecode'] = md5('c1edcb91fc0eb56a4699e0b31e942d06' . 'yohopatch2016');
|
|
|
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
// var_dump('android 4.3.0');
|
|
|
break;
|
|
|
default: // 默认
|
|
|
$result['data']['url'] = '';
|
|
|
$result['data']['patchv'] = '';
|
|
|
$result['data']['filecode'] = '';
|
|
|
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
|
|
|
// var_dump('android noversion');
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
// var_dump('no found app clienttype');
|
|
|
|
|
|
}
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|