master
ELF 4 years ago
parent 9973e72bf3
commit 5d92af7dcc

@ -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'];

@ -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,

Loading…
Cancel
Save