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);
|
||||
|
||||
Reference in New Issue
Block a user