更新
This commit is contained in:
@@ -20,13 +20,13 @@ class QywxPromotionPublicController extends BaseApiController
|
||||
return response('/* promotion pool not found */', 404, ['Content-Type' => 'application/javascript; charset=utf-8']);
|
||||
}
|
||||
// 由安装脚本自身的 src 解析 API 域名,避免把请求 Host 写入可公开缓存的 JavaScript。
|
||||
$goUrl = '/api/qywx-promotion/go/' . $key;
|
||||
$targetUrl = (string) ($pool['target_url'] ?? '');
|
||||
$config = QywxPromotionWidgetService::decode($pool['widget_config_json'] ?? null);
|
||||
$javascript = QywxPromotionWidgetService::renderScript(
|
||||
$key,
|
||||
$goUrl,
|
||||
$targetUrl,
|
||||
$config,
|
||||
(int) ($pool['status'] ?? 0) === 1
|
||||
(int) ($pool['status'] ?? 0) === 1 && $targetUrl !== ''
|
||||
);
|
||||
|
||||
return response($javascript, 200, [
|
||||
|
||||
Reference in New Issue
Block a user