分享页面缩略图自定义

This commit is contained in:
Dev
2026-10-14 17:38:24 +08:00
parent a070927b15
commit 44479dcb86
2 changed files with 22 additions and 1 deletions
@@ -184,6 +184,7 @@ class Common extends Api
$toLabels = function ($value) {
return array_values(array_filter(array_map('trim', explode(',', $value ?? ''))));
};
$shareImage = config('site.promotion_share_image') ?? '';
$config = [
'languageLabels' => $toLabels($code_languages),
'frontLabels' => $toLabels($front_techs),
@@ -192,6 +193,8 @@ class Common extends Api
'developTypes' => $developTypes,
// 平台服务费比例(0~1),前端据此计算开发者预计到手金额
'platform_commission_ratio' => (float)DemandService::getPlatformCommissionRatio(),
// 推广分享卡片预览图,未配置时为空
'promotion_share_image' => $shareImage ? cdnurl($shareImage, true) : '',
];
$this->success('', $config);