@ -130,6 +130,9 @@ $configs = array(
'service_3rd_api_key' => '你的密钥',
'sms_code_cache_time' => 600, //短信验证码缓存时长,单位:秒
//图片cdn加速域名配置
'img_cdn_budget_url' => '',
//Google Analytics MEASUREMENT ID
'GA_MEASUREMENT_ID' => 'G-09MWT3Z9R0',
@ -120,4 +120,14 @@ eof;
return $tmp_arr;
}
//获取用户图片的cdn地址
public static function getCDNImageUrl($localImgUrl) {
if (!empty(FSC::$app['config']['debug'])) {return $localImgUrl;}
$cdn = FSC::$app['config']['img_cdn_budget_url'];
if (empty($cdn)) {return $localImgUrl;}
return "{$cdn}{$localImgUrl}";
@ -47,7 +47,7 @@ $allTags = Html::getTagNames($viewData['tags']);
continue;
$snapshot = !empty($file['cover']) ? $imgPreffix . $file['cover'] : '/img/default.png';
$snapshot = !empty($file['cover']) ? Html::getCDNImageUrl($imgPreffix . $file['cover']) : '/img/default.png';
$title = !empty($file['title']) ? Html::mb_substr($file['title'], 0, 33, 'utf-8') : $file['filename'];
$platform = Html::getShareVideosPlatform($file['shortcut']['url']);
@ -56,7 +56,7 @@ eof;