Authored by 曹镏
Committed by Niall

调整app使用的hf接口

... ... @@ -46,30 +46,65 @@ class HfController extends AbstractAction
public function v1Action()
{
$result = array('code' => 200, 'message' => 'Config Success', 'md5' => '', 'data' => array());
$clienttype = $this->post('client_type');
$version = $this->post('app_version');
$ios = 'ios';
$android = 'android';
// 根据版本号返回补丁文件信息
$version = $this->post('app_version');
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.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']['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;
}
}
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);
}
... ...