From 5d92af7dccb13d6e22ad201860cf80097e553bbe Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 25 Mar 2021 19:11:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/HomeController.class.php | 11 +++++++++++ .../Home/Controller/PackageController.class.php | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index 30ed4bc2a..d74b348e0 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -177,6 +177,7 @@ class HomeController extends Controller { $testKey = I('test_key', ''); $code = I('code', ''); + $force = I('force', ''); $gameId = I('gid', 0); $promoteId = I('pid', 0); if ($code == '' && ($gameId == 0 || $promoteId == 0)) { @@ -216,6 +217,13 @@ class HomeController extends Controller $isIOS = Request::isIOS() || Request::isIPadOS(); $isAndroid = Request::isAndroid(); $isIOS13 = Request::isIOS13(); + if ($force == 'ios') { + $isIOS = true; + $isAndroid = false; + } elseif ($force == 'android') { + $isIOS = false; + $isAndroid = true; + } if ($testKey != '') { $tempDataDir = RUNTIME_PATH . 'Data'; @@ -301,6 +309,9 @@ class HomeController extends Controller $downloadUrl = 'itms-services://?action=download-manifest&url=' . Request::getHost() . ltrim($gameSource['org_plist_url'], '.'); } else { $downloadUrl = $applyService->getDownloadUrl($apply); + if ($force) { + $downloadUrl .= '/force/' . $force + } } $serviceQQ = M("config", "sys_")->field('value')->where("name='APP_QQ'")->find()['value']; diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index 4d6e33753..c0d2407bb 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -29,6 +29,7 @@ class PackageController extends Controller public function download() { $code = I('code', ''); + $force = I('force', ''); $gameId = I('game_id', 0); $promoteId = I('promote_id', 0); @@ -77,11 +78,11 @@ class PackageController extends Controller $game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find(); - if (Request::isMobile() || Request::isTablet()) { - if (!Request::isAndroid() && $game['sdk_version'] == 1) { + if (Request::isMobile() || Request::isTablet() || $force == 'ios' || $force == 'android') { + if (!(Request::isAndroid() || $force == 'android') && $game['sdk_version'] == 1) { $this->redirect("package/downloadError", ['message' => '请使用安卓浏览器下载']); } - if (!(Request::isIOS() || Request::isIPadOS()) && $game['sdk_version'] == 2) { + if (!(Request::isIOS() || Request::isIPadOS() || $force == 'ios') && $game['sdk_version'] == 2) { $this->redirect("package/downloadError", ['message' => '请使用ios浏览器下载']); } } @@ -104,7 +105,7 @@ class PackageController extends Controller M('user_action_log', 'tab_')->data($log)->add(); $downloadDomain = $applyService->getDownloadDomain(); - if (Request::isIOS() || Request::isIPadOS()) { + if (Request::isIOS() || Request::isIPadOS() || $force == 'ios') { $packageDownloadLogService = new PackageDownloadLogService(); $packageDownloadLogService->add([ 'user_id' => 0,