This commit is contained in:
@@ -131,6 +131,25 @@ $(function () {
|
||||
if (pluginRes && pluginRes.status === 200 && pluginRes.data) {
|
||||
var cfg = pluginRes.data || {};
|
||||
|
||||
// SEO:如配置了插件 SEO,则覆盖页面标题与 meta
|
||||
if (cfg.seo) {
|
||||
if (cfg.seo.title) {
|
||||
document.title = cfg.seo.title;
|
||||
}
|
||||
if (cfg.seo.keywords) {
|
||||
var $kw = $('meta[name="keywords"]');
|
||||
if ($kw.length) {
|
||||
$kw.attr("content", cfg.seo.keywords);
|
||||
}
|
||||
}
|
||||
if (cfg.seo.description) {
|
||||
var $desc = $('meta[name="description"]');
|
||||
if ($desc.length) {
|
||||
$desc.attr("content", cfg.seo.description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 覆盖基础字段:企业信息 & ICP 等
|
||||
baseData.enterprise_name =
|
||||
cfg.enterprise_name || baseData.enterprise_name;
|
||||
@@ -142,6 +161,9 @@ $(function () {
|
||||
cfg.enterprise_qrcode || baseData.enterprise_qrcode;
|
||||
baseData.official_website_logo =
|
||||
cfg.official_website_logo || baseData.official_website_logo;
|
||||
baseData.online_customer_service_link =
|
||||
cfg.online_customer_service_link ||
|
||||
baseData.online_customer_service_link;
|
||||
baseData.icp_info = cfg.icp_info || baseData.icp_info;
|
||||
baseData.icp_info_link =
|
||||
cfg.icp_info_link || baseData.icp_info_link;
|
||||
@@ -177,6 +199,15 @@ $(function () {
|
||||
if (cfg.feedback_type) {
|
||||
baseData.feedback_type = cfg.feedback_type;
|
||||
}
|
||||
if (cfg.header_nav) {
|
||||
baseData.header_nav = cfg.header_nav;
|
||||
}
|
||||
if (cfg.footer_nav) {
|
||||
baseData.footer_nav = cfg.footer_nav;
|
||||
}
|
||||
if (cfg.side_floating_window) {
|
||||
baseData.side_floating_window = cfg.side_floating_window;
|
||||
}
|
||||
}
|
||||
|
||||
sessionStorage.commentData = JSON.stringify(baseData);
|
||||
|
||||
@@ -21,6 +21,8 @@ class ThemeController extends PluginBaseController
|
||||
$config = $model->getConfig();
|
||||
|
||||
$data = [
|
||||
// SEO 配置单独返回,前端可用于覆盖 <title>/<meta> 等
|
||||
'seo' => $config['seo'] ?? [],
|
||||
'enterprise_name' => $config['site_config']['enterprise_name'] ?? '',
|
||||
'enterprise_telephone' => $config['site_config']['enterprise_telephone'] ?? '',
|
||||
'enterprise_mailbox' => $config['site_config']['enterprise_mailbox'] ?? '',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -97,6 +97,11 @@
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.upload-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mt-10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user