master
ELF 4 years ago
parent b4c1c68c42
commit b9092a4501

@ -77,11 +77,13 @@ class ApplyService {
return M('Apply', 'tab_')->save($data);
}
public function getDownloadUrl($apply)
public function getDownloadUrl($apply, $code = null)
{
$host = $this->getDownloadDomain();
$host = $host ? $host : Request::getHost();
if (!$code) {
$code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_DOWNLOAD);
}
return $host . '/index.php?s=/Home/Package/download/code/' . $code;
}

@ -312,7 +312,7 @@ class HomeController extends Controller
if (!$isNewIos && $isIOS13) {
$downloadUrl = 'itms-services://?action=download-manifest&url=' . Request::getHost() . ltrim($gameSource['org_plist_url'], '.');
} else {
$downloadUrl = $applyService->getDownloadUrl($apply);
$downloadUrl = $applyService->getDownloadUrl($apply, $code);
if ($force) {
$downloadUrl .= '/force/' . $force;
}

@ -82,16 +82,17 @@ class PackageController extends Controller
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find();
$sdkVersion = $game['sdk_version'];
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() || $force == 'ios') && $game['sdk_version'] == 2) {
$this->redirect("package/downloadError", ['message' => '请使用ios浏览器下载']);
if (Request::isAndroid() || $force == 'android') {
$sdkVersion = 1;
} elseif (Request::isIOS() || Request::isIPadOS() || $force == 'ios') {
$sdkVersion = 2;
}
}
$packageUrl = $game['sdk_version'] == 1 ? $apply['pack_url'] : $apply['plist_url'];
$packageUrl = $sdkVersion == 1 ? $apply['pack_url'] : $apply['plist_url'];
$apply = M('apply', 'tab_')->where(['promote_id' => $promoteId, 'game_id' => $gameId])->find();
$url = $applyService->getLandingPageUrl($apply);

Loading…
Cancel
Save