feat: 官方站点插件与主题新增产品跳转链接、自定义配置项等功能
18 个文件变更
+451
-46
13172193298@163.com
| •MPHX/frontend.php | +38 -2 |
| •admin/api/setting.php | +39 -0 |
| •app_plugins/official_site/bootstrap.php | +2 -0 |
| •app_plugins/official_site/install.sql | +1 -0 |
| •app_plugins/official_site/lib/site.php | +22 -4 |
| •app_plugins/official_site/views/admin/products.php | +25 -10 |
| •templates/default/admin/set.php | +8 -0 |
| •templates/tdesign/home/index.php | +25 -0 |
| •templates/tdesign/spa/src/admin/api/settings.js | +14 -0 |
| •templates/tdesign/spa/src/admin/views/settings/ThemeView.vue | +53 -1 |
| •templates/tdesign/spa/src/home/layouts/HomeLayout.vue | +8 -8 |
| •templates/tdesign/spa/src/home/styles/home.scss | +24 -3 |
| •templates/tdesign/spa/src/home/views/LandingView.vue | +13 -5 |
| •templates/tdesign/spa/src/home/views/site/AboutView.vue | +22 -6 |
| •templates/tdesign/spa/src/home/views/site/ContactView.vue | +4 -3 |
| •templates/tdesign/spa/src/home/views/site/products/ProductDetailView.vue | +17 -2 |
| •templates/tdesign/spa/src/home/views/site/products/ProductsView.vue | +19 -2 |
| •templates/tdesign/theme.php | +117 -0 |
变更内容
diff --git a/MPHX/frontend.php b/MPHX/frontend.php
index 6b5a8bf..21eb66e 100644
--- a/MPHX/frontend.php
+++ b/MPHX/frontend.php
@@ -230,7 +230,7 @@ function mnbt_home_dispatch(): bool
* mnbt_register_home_setting([
* 'key' => 'bg_color',
* 'label' => '背景颜色',
- * 'type' => 'color', // text | color | select | switch | textarea | number
+ * 'type' => 'color', // text | color | select | switch | textarea | number | image
* 'default' => '#f0f4ff',
* 'placeholder' => '#f0f4ff',
* 'hint' => '可选提示文本',
@@ -254,7 +254,7 @@ function mnbt_register_home_setting(array $config): bool
return false;
}
$type = (string)($config['type'] ?? 'text');
- if (!in_array($type, ['text', 'color', 'select', 'switch', 'textarea', 'number'], true)) {
+ if (!in_array($type, ['text', 'color', 'select', 'switch', 'textarea', 'number', 'image'], true)) {
$type = 'text';
}
if (isset($GLOBALS['mnbt_home_settings_fields'][$key])) {
@@ -408,6 +408,19 @@ function mnbt_home_render_settings_fields_default(): string
. '<input type="number" class="form-control" name="' . $key . '" value="' . $val . '" placeholder="' . $ph . '"/>'
. $hint . '</div>';
break;
+ case 'image':
+ $prevStyle = $val !== '' ? '' : ' style="display:none"';
+ $html .= '<div class="mn-set-field"><label>' . $label . '</label>'
+ . '<div style="display:flex;align-items:center;gap:10px;margin-bottom:8px;">'
+ . '<img id="' . $key . '_preview" src="' . ($val !== '' ? '../' . htmlspecialchars($val, ENT_QUOTES, 'UTF-8') : '') . '"'
+ . ' alt="" style="width:120px;height:76px;object-fit:cover;border:1px solid #e5e7eb;border-radius:8px;background:#f8f9fa;"' . $prevStyle . '>'
+ . '<input type="file" id="' . $key . '_file" accept=".png,.jpg,.jpeg,.gif,.webp,.ico" style="display:none">'
+ . '<button type="button" class="btn btn-outline-secondary" onclick="document.getElementById(\'' . $key . '_file\').click()">上传图片</button>'
+ . '<button type="button" class="btn btn-outline-secondary" onclick="var i=document.getElementById(\'' . $key . '\');i.value=\'\';var p=document.getElementById(\'' . $key . '_preview\');p.style.display=\'none\';p.src=\'\';">清除</button>'
+ . '</div>'
+ . '<input type="text" class="form-control" id="' . $key . '" name="' . $key . '" data-home-image="' . $key . '" value="' . $val . '" placeholder="' . $ph . '"/>'
+ . $hint . '</div>';
+ break;
default: // text
$html .= '<div class="mn-set-field"><label>' . $label . '</label>'
. '<input type="text" class="form-control" name="' . $key . '" value="' . $val . '" placeholder="' . $ph . '"/>'
@@ -424,5 +437,28 @@ function mnbt_home_render_settings_fields_default(): string
. 'el.value=cb.checked?"true":"false";'
. 'cb.addEventListener("change",function(){el.value=cb.checked?"true":"false"})'
. '})})()</script>';
+ // image 字段上传脚本(POST 到 ./ajax.php?gn=home_upload_image)
+ $html .= '<script>(function(){'
+ . 'document.querySelectorAll(\'input[data-home-image]\').forEach(function(input){'
+ . 'var k=input.getAttribute(\'data-home-image\');'
+ . 'var file=document.getElementById(k+\'_file\');'
+ . 'if(!file)return;'
+ . 'file.addEventListener(\'change\',function(){'
+ . 'if(!file.files||!file.files.length)return;'
+ . 'var fd=new FormData();'
+ . 'fd.append(\'gn\',\'home_upload_image\');'
+ . 'fd.append(\'key\',k.replace(\'home_ts_\',\'\'));'
+ . 'fd.append(\'image\',file.files[0]);'
+ . '$.ajax({url:\'./ajax.php\',type:\'POST\',data:fd,processData:false,contentType:false,'
+ . 'success:function(r){var j;try{j=typeof r===\'string\'?JSON.parse(r):r;}catch(e){j={code:\'响应解析失败\'};}'
+ . 'if(j.code===\'上传成功\'){var rel=\'imsetes/upload_logo/home_\'+k.replace(\'home_ts_\',\'\')+\'.png\';'
+ . 'input.value=rel;var p=document.getElementById(k+\'_preview\');'
+ . 'if(p){p.src=\'../\'+rel;p.style.display=\'\';}'
+ . 'if(typeof msalert===\'function\'){msalert(1,\'上传成功,请点击保存\',2000);}'
+ . '}else{if(typeof msalert===\'function\'){msalert(4,j.code||\'上传失败\',2000);}}'
+ . '},error:function(){if(typeof msalert===\'function\'){msalert(4,\'网络错误,请重试\',2000);}}'
+ . '});'
+ . '})'
+ . '})})()</script>';
return $html;
}
diff --git a/admin/api/setting.php b/admin/api/setting.php
index 71cc2b8..88c3188 100644
--- a/admin/api/setting.php
+++ b/admin/api/setting.php
@@ -194,6 +194,45 @@ if($egn == 'home_upload_icon')
json_exit('上传成功');
return;
}
+if($egn == 'home_upload_image')
+{
+ // 通用主页图片上传:key 必须是当前主页主题注册的 image 类型字段
+ // 保存到 imsetes/upload_logo/home_{key}.png,路径由前端随 save_home_settings 统一提交
+ $key = (string)($_POST['key'] ?? '');
+ if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]{0,63}$/', $key)) {
+ json_exit('参数错误');
+ }
+ if (function_exists('mnbt_home_get_settings_fields')) {
+ $fields = mnbt_home_get_settings_fields();
+ $isImage = isset($fields[$key]) && ($fields[$key]['type'] ?? '') === 'image';
+ if (!$isImage) {
+ json_exit('非法字段');
+ }
+ }
+ if (empty($_FILES['image']) || !is_array($_FILES['image']) || (int)($_FILES['image']['error'] ?? 1) !== 0) {
+ json_exit('未收到文件或上传失败');
+ }
+ $file = $_FILES['image'];
+ $name = (string)($file['name'] ?? '');
+ $ext = strtolower(pathinfo($name, PATHINFO_EXTENSION));
+ if (!in_array($ext, ['png', 'jpg', 'jpeg', 'gif', 'ico', 'webp'])) {
+ json_exit('仅支持 png / jpg / gif / webp / ico 格式');
+ }
+ $tmp = (string)($file['tmp_name'] ?? '');
+ if ($tmp === '' || !is_uploaded_file($tmp)) {
+ json_exit('文件上传异常');
+ }
+ $dir = ROOT . 'imsetes/upload_logo/';
+ if (!is_dir($dir) && !@mkdir($dir, 0755, true)) {
+ json_exit('上传目录不可写');
+ }
+ $filename = 'home_' . $key . '.png';
+ if (!move_uploaded_file($tmp, $dir . $filename)) {
+ json_exit('保存文件失败,请检查 imsetes/upload_logo 目录权限');
+ }
+ json_exit('上传成功');
+ return;
+}
if($egn == 'settheme')
{
$usertheme = mnbt_theme_sanitize($_POST['usertheme'] ?? '');
diff --git a/app_plugins/official_site/bootstrap.php b/app_plugins/official_site/bootstrap.php
index 5f7df54..a41743b 100644
--- a/app_plugins/official_site/bootstrap.php
+++ b/app_plugins/official_site/bootstrap.php
@@ -39,6 +39,7 @@ mnbt_register_route('GET', '/site/api/products', function ($params, $ctx) {
'description' => (string)$p['description'],
'features' => $p['features_list'],
'image' => (string)($p['image'] ?? ''),
+ 'link' => (string)($p['link'] ?? ''),
];
}
$cats = [];
@@ -65,6 +66,7 @@ mnbt_register_route('GET', '/site/api/products/{product_id}', function ($params,
'description' => (string)$p['description'],
'features' => $p['features_list'],
'image' => (string)($p['image'] ?? ''),
+ 'link' => (string)($p['link'] ?? ''),
'created_at' => (string)($p['created_at'] ?? ''),
]]);
});
diff --git a/app_plugins/official_site/install.sql b/app_plugins/official_site/install.sql
index 30f30dc..4af2ccc 100644
--- a/app_plugins/official_site/install.sql
+++ b/app_plugins/official_site/install.sql
@@ -10,6 +10,7 @@ CREATE TABLE `MN_plugin_site_product` (
`description` text NOT NULL COMMENT '产品简介',
`features` text NOT NULL COMMENT '特性列表 JSON 数组',
`image` varchar(500) NOT NULL DEFAULT '' COMMENT '展示图片 URL',
+ `link` varchar(500) NOT NULL DEFAULT '' COMMENT '跳转链接(配置后产品卡片点击直接跳转,站内路径或 http(s) 外链)',
`status` varchar(20) NOT NULL DEFAULT 'active' COMMENT 'active/inactive',
`sort` int(11) NOT NULL DEFAULT '50' COMMENT '排序(小到大)',
`created_at` varchar(50) NOT NULL DEFAULT '',
diff --git a/app_plugins/official_site/lib/site.php b/app_plugins/official_site/lib/site.php
index a906700..293b119 100644
--- a/app_plugins/official_site/lib/site.php
+++ b/app_plugins/official_site/lib/site.php
@@ -68,6 +68,21 @@ function site_product_features_parse($row)
return $features;
}
+/** 产品表结构迁移:确保 link 列存在(老版本升级,幂等)。 */
+function site_product_ensure_schema()
+{
+ static $done = false;
+ if ($done) {
+ return;
+ }
+ $done = true;
+ global $DB;
+ $cols = $DB->get_all_prepare("SHOW COLUMNS FROM `MN_plugin_site_product` LIKE 'link'") ?: [];
+ if (empty($cols)) {
+ @$DB->query("ALTER TABLE `MN_plugin_site_product` ADD COLUMN `link` varchar(500) NOT NULL DEFAULT '' COMMENT '跳转链接' AFTER `image`");
+ }
+}
+
/**
* 产品列表。
* @param string $status ''=全部,'active'/'inactive'
@@ -76,6 +91,7 @@ function site_product_features_parse($row)
function site_product_list($status = '', $category = '')
{
global $DB;
+ site_product_ensure_schema();
$sql = "SELECT * FROM MN_plugin_site_product";
$where = [];
$args = [];
@@ -104,6 +120,7 @@ function site_product_list($status = '', $category = '')
function site_product_get($id)
{
global $DB;
+ site_product_ensure_schema();
$row = $DB->get_row_prepare("SELECT * FROM MN_plugin_site_product WHERE id=? LIMIT 1", [(int)$id]) ?: null;
if ($row) {
$row['features_list'] = site_product_features_parse($row);
@@ -126,6 +143,7 @@ function site_product_save($data)
'description' => trim((string)($data['description'] ?? '')),
'features' => json_encode($features, JSON_UNESCAPED_UNICODE),
'image' => trim((string)($data['image'] ?? '')),
+ 'link' => trim((string)($data['link'] ?? '')),
'status' => ($data['status'] ?? 'active') === 'inactive' ? 'inactive' : 'active',
'sort' => max(0, (int)($data['sort'] ?? 50)),
];
@@ -139,14 +157,14 @@ function site_product_save($data)
$id = (int)($data['id'] ?? 0);
if ($id > 0) {
$ok = $DB->query_prepare(
- "UPDATE MN_plugin_site_product SET name=?, category=?, description=?, features=?, image=?, status=?, sort=? WHERE id=?",
- [$fields['name'], $fields['category'], $fields['description'], $fields['features'], $fields['image'], $fields['status'], $fields['sort'], $id]
+ "UPDATE MN_plugin_site_product SET name=?, category=?, description=?, features=?, image=?, link=?, status=?, sort=? WHERE id=?",
+ [$fields['name'], $fields['category'], $fields['description'], $fields['features'], $fields['image'], $fields['link'], $fields['status'], $fields['sort'], $id]
);
return $ok ? true : '更新失败';
}
$ok = $DB->query_prepare(
- "INSERT INTO MN_plugin_site_product (name, category, description, features, image, status, sort, created_at) VALUES (?,?,?,?,?,?,?,?)",
- [$fields['name'], $fields['category'], $fields['description'], $fields['features'], $fields['image'], $fields['status'], $fields['sort'], $now]
+ "INSERT INTO MN_plugin_site_product (name, category, description, features, image, link, status, sort, created_at) VALUES (?,?,?,?,?,?,?,?,?)",
+ [$fields['name'], $fields['category'], $fields['description'], $fields['features'], $fields['image'], $fields['link'], $fields['status'], $fields['sort'], $now]
);
return $ok ? true : '新增失败';
}
diff --git a/app_plugins/official_site/views/admin/products.php b/app_plugins/official_site/views/admin/products.php
index c291eb5..ceaed46 100644
--- a/app_plugins/official_site/views/admin/products.php
+++ b/app_plugins/official_site/views/admin/products.php
@@ -25,6 +25,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
'description' => $_POST['description'] ?? '',
'features' => $features,
'image' => $_POST['image'] ?? '',
+ 'link' => $_POST['link'] ?? '',
'status' => $_POST['status'] ?? 'active',
'sort' => (int)($_POST['sort'] ?? 50),
];
@@ -82,10 +83,10 @@ mnbt_admin_include('head');
<tr>
<th style="width:60px">ID</th>
<th>产品名称</th>
- <th style="width:120px">分类</th>
+ <th style="width:110px">分类</th>
<th>简介</th>
+ <th style="width:130px">跳转链接</th>
<th style="width:80px">状态</th>
- <th style="width:70px">排序</th>
<th style="width:170px">操作</th>
</tr>
</thead>
@@ -96,14 +97,20 @@ mnbt_admin_include('head');
<td><?= htmlspecialchars($p['name'], ENT_QUOTES) ?></td>
<td><?= htmlspecialchars($categories[$p['category']] ?? $p['category'], ENT_QUOTES) ?></td>
<td><?= htmlspecialchars(mb_substr($p['description'], 0, 40), ENT_QUOTES) ?><?= mb_strlen($p['description']) > 40 ? '…' : '' ?></td>
- <td>
- <?php if ($p['status'] === 'active'): ?>
- <span class="badge badge-success">上架</span>
- <?php else: ?>
- <span class="badge badge-secondary">下架</span>
- <?php endif; ?>
- </td>
- <td><?= (int)$p['sort'] ?></td>
+ <td>
+ <?php if (!empty($p['link'])): ?>
+ <a href="<?= htmlspecialchars($p['link'], ENT_QUOTES) ?>" target="_blank" rel="noopener" class="text-primary"><?= htmlspecialchars(mb_substr($p['link'], 0, 22), ENT_QUOTES) ?><?= mb_strlen($p['link']) > 22 ? '…' : '' ?></a>
+ <?php else: ?>
+ <span class="text-muted">—</span>
+ <?php endif; ?>
+ </td>
+ <td>
+ <?php if ($p['status'] === 'active'): ?>
+ <span class="badge badge-success">上架</span>
+ <?php else: ?>
+ <span class="badge badge-secondary">下架</span>
+ <?php endif; ?>
+ </td>
<td>
<button type="button" class="btn btn-sm btn-outline-primary" onclick="openEdit(<?= (int)$p['id'] ?>)">编辑</button>
<form method="post" style="display:inline-block" onsubmit="var b=this.querySelector('button');b.disabled=true;b.textContent='删除中...';return confirm('确定删除此产品?')">
@@ -158,6 +165,11 @@ mnbt_admin_include('head');
<label>展示图片(URL,可选)</label>
<input type="text" class="form-control" name="image" id="f-image" placeholder="https://example.com/image.png">
</div>
+ <div class="form-group">
+ <label>跳转链接(可选)</label>
+ <input type="text" class="form-control" name="link" id="f-link" placeholder="/shop 或 https://example.com/product">
+ <small class="form-text text-muted">配置后,产品中心卡片点击将直接跳转到该链接(站内路径或 http(s) 外链);留空则进入产品详情页。</small>
+ </div>
<div class="form-row">
<div class="col-6">
<div class="form-group">
@@ -202,6 +214,7 @@ function openEdit(id) {
el('description').value = p.description || '';
el('features').value = (p.features_list || []).join('\n');
el('image').value = p.image || '';
+ el('link').value = p.link || '';
el('status').value = p.status || 'active';
el('sort').value = p.sort || 50;
}
@@ -211,6 +224,7 @@ function openEdit(id) {
el('description').value = '';
el('features').value = '';
el('image').value = '';
+ el('link').value = '';
el('status').value = 'active';
el('sort').value = 50;
}
@@ -222,6 +236,7 @@ function openEdit(id) {
el('description').value = __siteForm.description || '';
el('features').value = (__siteForm.features || []).join('\n');
el('image').value = __siteForm.image || '';
+ el('link').value = __siteForm.link || '';
el('status').value = __siteForm.status || 'active';
el('sort').value = __siteForm.sort || 50;
}
diff --git a/templates/default/admin/set.php b/templates/default/admin/set.php
index 557abec..6456f18 100644
--- a/templates/default/admin/set.php
+++ b/templates/default/admin/set.php
@@ -596,6 +596,14 @@ function saveHome() {
home_show_notice: $('#home_show_notice').is(':checked') ? 'true' : 'false',
home_show_plans: $('#home_show_plans').is(':checked') ? 'true' : 'false',
};
+ // 主题自定义设置字段(name 以 home_ts_ 开头的 input/textarea/select)
+ document.querySelectorAll('#home_save_form [name^="home_ts_"], input[name^="home_ts_"], textarea[name^="home_ts_"], select[name^="home_ts_"]').forEach(function (el) {
+ if (el.type === 'checkbox') {
+ data[el.name] = el.checked ? 'true' : 'false';
+ } else {
+ data[el.name] = el.value || '';
+ }
+ });
$.post('./ajax.php', data, function (r) {
var j = JSON.parse(r);
msalert(j.code === '修改成功' ? 1 : 4, j.code || '保存失败', 2000);
diff --git a/templates/tdesign/home/index.php b/templates/tdesign/home/index.php
index 5fee2e8..417d61c 100644
--- a/templates/tdesign/home/index.php
+++ b/templates/tdesign/home/index.php
@@ -26,6 +26,31 @@ $boot = [
'siteFooter' => $site_footer ?? '',
'beianInfo' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('beian_info', '') : ''),
'policeBeian' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('ps_beian', '') : ''),
+ // 页脚/联系方式/关于/首页 banner 文字(主题自定义设置,空值回退内置默认)
+ 'footerAbout' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('footer_about', '致力于为客户提供稳定、安全、高性能的虚拟主机与云计算服务。') : ''),
+ 'contactQq' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('contact_qq', '994752422') : ''),
+ 'contactEmail' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('contact_email', 'support@mnbt.example') : ''),
+ 'contactAddress' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('contact_address', '北京市朝阳区 · 数据中心园区') : ''),
+ 'contactHours' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('contact_hours', '工作日 9:00 - 21:00 · 7×24 工单系统') : ''),
+ 'aboutIntro' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('about_intro', '') : ''),
+ 'aboutImage' => (function_exists('mnbt_home_asset') && function_exists('mnbt_home_theme_setting') ? mnbt_home_asset((string)mnbt_home_theme_setting('about_image', '')) : ''),
+ 'bannerTexts' => [
+ [
+ 'title' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_title_1', '高性能虚拟主机') : '高性能虚拟主机'),
+ 'subtitle' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_subtitle_1', '即买即用 · 自动开通 · 秒级部署') : '即买即用 · 自动开通 · 秒级部署'),
+ 'description' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_desc_1', '全 SSD 存储与 BGP 多线接入,支付完成后自动开通,分钟级上线,为企业和开发者打造稳定高效的主机平台。') : '全 SSD 存储与 BGP 多线接入,支付完成后自动开通,分钟级上线,为企业和开发者打造稳定高效的主机平台。'),
+ ],
+ [
+ 'title' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_title_2', '专业团队支持') : '专业团队支持'),
+ 'subtitle' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_subtitle_2', '7×24 小时全天候技术支持') : '7×24 小时全天候技术支持'),
+ 'description' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_desc_2', '经验丰富的运维与开发团队随时待命,从建站到运维全程护航,让您专注于业务本身。') : '经验丰富的运维与开发团队随时待命,从建站到运维全程护航,让您专注于业务本身。'),
+ ],
+ [
+ 'title' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_title_3', '企业级安全防护') : '企业级安全防护'),
+ 'subtitle' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_subtitle_3', 'DDoS 清洗 · WAF 规则 · 每日备份') : 'DDoS 清洗 · WAF 规则 · 每日备份'),
+ 'description' => (function_exists('mnbt_home_theme_setting') ? (string)mnbt_home_theme_setting('banner_desc_3', '内置安全防护体系与自动备份能力,SSL 一键签发,全面保障您的数据与业务安全。') : '内置安全防护体系与自动备份能力,SSL 一键签发,全面保障您的数据与业务安全。'),
+ ],
+ ],
'favicon' => $favicon ?? '',
'notice' => $notice ?? '',
'showNotice' => !empty($show_notice),
diff --git a/templates/tdesign/spa/src/admin/api/settings.js b/templates/tdesign/spa/src/admin/api/settings.js
index 946b16e..43097a4 100644
--- a/templates/tdesign/spa/src/admin/api/settings.js
+++ b/templates/tdesign/spa/src/admin/api/settings.js
@@ -64,3 +64,17 @@ export async function uploadHomeIcon(target, file) {
if (!r.ok) MessagePlugin.error(r.message || '上传失败')
return r
}
+
+/** 上传主页自定义图片字段: key 为 image 类型字段 key */
+export async function uploadHomeImage(key, file) {
+ const boot = window.__TD_BOOT__ || {}
+ const url = boot.ajaxBase || './ajax.php'
+ const fd = new FormData()
+ fd.append('gn', 'home_upload_image')
+ fd.append('key', key)
+ fd.append('image', file)
+ const res = await http.post(url, fd)
+ const r = parseResult(res.data)
+ if (!r.ok) MessagePlugin.error(r.message || '上传失败')
+ return r
+}
diff --git a/templates/tdesign/spa/src/admin/views/settings/ThemeView.vue b/templates/tdesign/spa/src/admin/views/settings/ThemeView.vue
index 5b13484..be12beb 100644
--- a/templates/tdesign/spa/src/admin/views/settings/ThemeView.vue
+++ b/templates/tdesign/spa/src/admin/views/settings/ThemeView.vue
@@ -288,6 +288,25 @@
<t-textarea v-model="themeValues[f.key]" :autosize="{ minRows: 3, maxRows: 8 }" :placeholder="f.placeholder || ''" />
<div v-if="f.hint" class="td-form-hint">{{ f.hint }}</div>
</div>
+ <!-- image -->
+ <div v-else-if="f.type === 'image'" class="td-form-row">
+ <label>{{ f.label }}</label>
+ <div class="home-upload-row">
+ <img v-if="themeImagePreview(f.key)" :src="themeImagePreview(f.key)" alt="" class="home-image-preview" />
+ <span v-else class="home-logo-empty">未设置</span>
+ <input
+ :ref="(el) => setImageInput(f.key, el)"
+ type="file"
+ accept=".png,.jpg,.jpeg,.gif,.webp,.ico"
+ style="display: none"
+ @change="onUploadThemeImage(f.key)"
+ />
+ <t-button variant="outline" @click="triggerImageUpload(f.key)"><i class="mdi mdi-upload"></i> 上传</t-button>
+ <t-button variant="outline" theme="danger" @click="themeValues[f.key] = ''">清除</t-button>
+ </div>
+ <t-input v-model="themeValues[f.key]" placeholder="上传后自动填入,或手动填写 URL" clearable />
+ <div v-if="f.hint" class="td-form-hint">{{ f.hint }}</div>
+ </div>
</template>
<div class="td-form-actions">
@@ -311,7 +330,7 @@
<script setup>
import { reactive, ref, computed } from 'vue'
import { MessagePlugin } from 'tdesign-vue-next'
-import { setTheme, setHome, uploadHomeIcon } from '@/admin/api/settings'
+import { setTheme, setHome, uploadHomeIcon, uploadHomeImage } from '@/admin/api/settings'
const boot = window.__TD_BOOT__ || {}
// 防御:boot.themeList 可能是对象(关联数组 json_encode 后)或数组,统一转成数组
@@ -408,6 +427,31 @@ const homeForm = reactive({
const logoPreview = computed(() => resolveAsset(homeForm.home_logo))
+/* ===== 主题 image 类型字段上传 ===== */
+const imageInputs = {}
+function setImageInput(key, el) {
+ if (el) imageInputs[key] = el
+}
+function triggerImageUpload(key) {
+ imageInputs[key]?.click()
+}
+function themeImagePreview(key) {
+ return resolveAsset(themeValues[key] || '')
+}
+async function onUploadThemeImage(key) {
+ const input = imageInputs[key]
+ if (!input?.files?.length) return
+ const file = input.files[0]
+ homeLoading.value = true
+ const r = await uploadHomeImage(key, file)
+ input.value = ''
+ if (r.ok) {
+ themeValues[key] = 'imsetes/upload_logo/home_' + key + '.png'
+ MessagePlugin.success('上传成功,请保存设置')
+ }
+ homeLoading.value = false
+}
+
async function onUpload(target) {
const input = target === 'logo' ? logoInput.value : faviconInput.value
if (!input?.files?.length) return
@@ -506,4 +550,12 @@ async function saveHome() {
border-radius: 8px;
padding: 6px 12px;
}
+.home-image-preview {
+ width: 140px;
+ height: 88px;
+ object-fit: cover;
+ border: 1px solid #e5e7eb;
+ border-radius: 8px;
+ background: #f8f9fa;
+}
</style>
diff --git a/templates/tdesign/spa/src/home/layouts/HomeLayout.vue b/templates/tdesign/spa/src/home/layouts/HomeLayout.vue
index 70b8e53..492ae17 100644
--- a/templates/tdesign/spa/src/home/layouts/HomeLayout.vue
+++ b/templates/tdesign/spa/src/home/layouts/HomeLayout.vue
@@ -21,14 +21,14 @@
<div class="hd-nav-actions">
<template v-if="authState.loggedIn">
<span class="hd-user-name">{{ authState.user?.username }}</span>
- <t-button size="small" variant="outline" theme="default" @click="onLogout">退出</t-button>
+ <t-button theme="default" variant="outline" @click="onLogout">退出</t-button>
</template>
<template v-else-if="boot.hasUser">
<router-link to="/login">
- <t-button size="small" variant="outline" theme="default">登录</t-button>
+ <t-button theme="default" variant="outline">登录</t-button>
</router-link>
<router-link to="/register">
- <t-button size="small" theme="primary">免费注册</t-button>
+ <t-button theme="primary">免费注册</t-button>
</router-link>
</template>
</div>
@@ -49,11 +49,11 @@
<div class="hd-footer-content">
<div class="hd-footer-section hd-company-info">
<h3>{{ boot.siteTitle || 'MNBT' }}</h3>
- <p>致力于为客户提供稳定、安全、高性能的虚拟主机与云计算服务。</p>
+ <p>{{ boot.footerAbout || '致力于为客户提供稳定、安全、高性能的虚拟主机与云计算服务。' }}</p>
<div class="hd-social-links">
<a href="#" class="hd-social-link" aria-label="QQ 群" @click.prevent><i class="mdi mdi-qqchat"></i></a>
<a href="#" class="hd-social-link" aria-label="邮箱" @click.prevent><i class="mdi mdi-email-outline"></i></a>
- <a href="#" class="hd-social-link" aria-label="GitHub" @click.prevent><i class="mdi mdi-github"></i></a>
+ <a href="#" class="hd-social-link" aria-label="GitHub" @click.prevent><i class="mdi mdi-github-circle"></i></a>
</div>
</div>
<div class="hd-footer-section hd-quick-links">
@@ -70,15 +70,15 @@
<h4>联系方式</h4>
<div class="hd-contact-item">
<span class="icon"><i class="mdi mdi-qqchat"></i></span>
- <span class="info">官方 QQ 群:994752422</span>
+ <span class="info">官方 QQ 群:{{ boot.contactQq || '994752422' }}</span>
</div>
<div class="hd-contact-item">
<span class="icon"><i class="mdi mdi-email-outline"></i></span>
- <span class="info">1181469655@qq.com</span>
+ <span class="info">{{ boot.contactEmail || 'support@mnbt.example' }}</span>
</div>
<div class="hd-contact-item">
<span class="icon"><i class="mdi mdi-map-marker-outline"></i></span>
- <span class="info">MNBT 虚拟主机平台</span>
+ <span class="info">{{ boot.contactAddress || 'MNBT 虚拟主机平台' }}</span>
</div>
</div>
</div>
diff --git a/templates/tdesign/spa/src/home/styles/home.scss b/templates/tdesign/spa/src/home/styles/home.scss
index 71cfec9..2119a4d 100644
--- a/templates/tdesign/spa/src/home/styles/home.scss
+++ b/templates/tdesign/spa/src/home/styles/home.scss
@@ -24,14 +24,35 @@
--hd-ease: cubic-bezier(0.4, 0, 0.2, 1);
--hd-dur: 0.2s;
- /* 覆盖 TDesign 品牌色为官网绿色(仅 home scope 生效) */
+ /* 覆盖 TDesign 品牌色为官网绿色(仅 home scope 生效)
+ * 必须完整覆盖调色板 --td-brand-color-1~10 及派生变量,
+ * 否则组件默认色仍读取默认蓝色系 */
+ --td-brand-color-1: #e6f7f0;
+ --td-brand-color-2: #c9efe0;
+ --td-brand-color-3: #9fdfc3;
+ --td-brand-color-4: #6fcfa3;
+ --td-brand-color-5: #4bc18e;
+ --td-brand-color-6: #42b983;
+ --td-brand-color-7: #359c6d;
+ --td-brand-color-8: #2c815c;
+ --td-brand-color-9: #23674a;
+ --td-brand-color-10: #1a4d38;
+ --td-brand-color: #42b983;
+ --td-brand-color-hover: #359c6d;
+ --td-brand-color-active: #2c815c;
+ --td-brand-color-focus: rgba(66, 185, 131, 0.2);
+ --td-brand-color-disabled: rgba(66, 185, 131, 0.4);
+ --td-brand-color-light: #e6f7f0;
+ --td-brand-color-light-hover: #c9efe0;
+ --td-text-color-brand: #42b983;
+ --td-text-color-link: #359c6d;
+ /* 兼容旧命名(部分组件仍引用) */
--td-brand: #42b983;
--td-brand-light: #e6f7f0;
--td-brand-dark: #359c6d;
--td-brand-hover: #359c6d;
- --td-brand-active: #359c6d;
+ --td-brand-active: #2c815c;
--td-brand-focus: rgba(66, 185, 131, 0.2);
- --td-brand-color-hover: #359c6d;
}
/* ============ 布局容器 ============ */
diff --git a/templates/tdesign/spa/src/home/views/LandingView.vue b/templates/tdesign/spa/src/home/views/LandingView.vue
index 5219fd6..bf961e3 100644
--- a/templates/tdesign/spa/src/home/views/LandingView.vue
+++ b/templates/tdesign/spa/src/home/views/LandingView.vue
@@ -197,26 +197,34 @@ const aboutUrl = computed(() =>
: (boot.hasUser ? (authState.loggedIn ? '/profile' : '/login') : '/')
)
-const carouselItems = [
+// 三张轮播文案:优先使用后台「主页内容」配置,未配置时回退内置默认
+const defaultBannerTexts = [
{
title: '高性能虚拟主机',
subtitle: '即买即用 · 自动开通 · 秒级部署',
description: '全 SSD 存储与 BGP 多线接入,支付完成后自动开通,分钟级上线,为企业和开发者打造稳定高效的主机平台。',
- image: bg1,
},
{
title: '专业团队支持',
subtitle: '7×24 小时全天候技术支持',
description: '经验丰富的运维与开发团队随时待命,从建站到运维全程护航,让您专注于业务本身。',
- image: bg2,
},
{
title: '企业级安全防护',
subtitle: 'DDoS 清洗 · WAF 规则 · 每日备份',
description: '内置安全防护体系与自动备份能力,SSL 一键签发,全面保障您的数据与业务安全。',
- image: bg3,
},
]
+const bannerTexts =
+ boot.bannerTexts && boot.bannerTexts.length >= 3
+ ? boot.bannerTexts
+ : defaultBannerTexts
+
+const carouselItems = [
+ { ...bannerTexts[0], image: bg1 },
+ { ...bannerTexts[1], image: bg2 },
+ { ...bannerTexts[2], image: bg3 },
+]
const currentSlide = ref(0)
let timer = null
@@ -243,7 +251,7 @@ function stopAutoPlay() {
const features = [
{ icon: 'mdi-shield-check', title: '稳定可靠', desc: '企业级硬件架构与 BGP 多线接入,SLA 99.9% 保障,网站始终在线。' },
- { icon: 'mdi-rocket-launch-outline', title: '极速开通', desc: '支付成功自动开通主机,分钟级上线,无需等待人工处理。' },
+ { icon: 'mdi-rocket', title: '极速开通', desc: '支付成功自动开通主机,分钟级上线,无需等待人工处理。' },
{ icon: 'mdi-headset', title: '专业服务', desc: '7×24 小时技术支持,从建站到运维全程护航,问题快速响应。' },
]
diff --git a/templates/tdesign/spa/src/home/views/site/AboutView.vue b/templates/tdesign/spa/src/home/views/site/AboutView.vue
index fd3479c..0c6b258 100644
--- a/templates/tdesign/spa/src/home/views/site/AboutView.vue
+++ b/templates/tdesign/spa/src/home/views/site/AboutView.vue
@@ -12,13 +12,11 @@
<div class="site-about-grid">
<div class="site-about-text">
<h2>平台简介</h2>
- <p>
- MNBT 是一家面向企业和开发者的云计算服务商,专注于虚拟主机、云服务器、域名与安全防护等基础设施服务。依托高性能节点与全自动化部署体系,帮助用户以极低的成本快速上线业务。
- </p>
- <p>我们坚持"稳定、安全、简单"的产品理念,通过持续的技术迭代和完善的售后服务,已为大量个人站长与中小企业提供可靠的托管服务。</p>
+ <p v-for="(para, i) in introParagraphs" :key="i">{{ para }}</p>
</div>
<div class="site-about-image">
- <div class="site-ph">数据中心 · 高性能节点</div>
+ <div v-if="boot.aboutImage" class="site-about-img" :style="{ backgroundImage: `url(${boot.aboutImage})` }"></div>
+ <div v-else class="site-ph">数据中心 · 高性能节点</div>
</div>
</div>
</div>
@@ -42,7 +40,7 @@
</ul>
</div>
<div class="site-mv-card">
- <div class="site-mv-icon"><i class="mdi mdi-rocket-launch-outline"></i></div>
+ <div class="site-mv-icon"><i class="mdi mdi-rocket"></i></div>
<h3>我们的愿景</h3>
<p>成为国内领先的轻量云服务品牌,让建站与托管像水电一样简单可靠,助力数字世界的每个创意落地。</p>
<ul class="site-mv-list">
@@ -76,10 +74,20 @@
</template>
<script setup>
+import { computed } from 'vue'
import bg2 from '@/shared/assets/bg2.jpg'
+const boot = window.__TD_BOOT__ || {}
const headerImage = bg2
+// 平台简介:优先使用后台「主页内容」配置,空行分段渲染,未配置回退内置文案
+const defaultIntro =
+ 'MNBT 是一家面向企业和开发者的云计算服务商,专注于虚拟主机、云服务器、域名与安全防护等基础设施服务。依托高性能节点与全自动化部署体系,帮助用户以极低的成本快速上线业务。\n\n我们坚持"稳定、安全、简单"的产品理念,通过持续的技术迭代和完善的售后服务,已为大量个人站长与中小企业提供可靠的托管服务。'
+const introParagraphs = computed(() => {
+ const text = (boot.aboutIntro || defaultIntro).trim()
+ return text.split(/\n\s*\n/).filter(Boolean)
+})
+
const teams = [
{ icon: 'mdi-server-network', title: '技术研发', role: '产品与架构', bio: '负责平台架构、自动化开通与功能迭代,持续打磨易用性。' },
{ icon: 'mdi-shield-lock', title: '安全合规', role: '安全运维', bio: '保障数据中心与业务系统的安全,通过等保三级等权威认证。' },
@@ -205,6 +213,14 @@ const teams = [
border: 1px solid var(--hd-border);
}
+.site-about-image .site-about-img {
+ height: 260px;
+ border-radius: var(--hd-radius-xl);
+ background-size: cover;
+ background-position: center;
+ border: 1px solid var(--hd-border);
+}
+
/* 使命愿景 */
.site-mv-grid {
display: grid;
diff --git a/templates/tdesign/spa/src/home/views/site/ContactView.vue b/templates/tdesign/spa/src/home/views/site/ContactView.vue
index bc5bc6b..12e1732 100644
--- a/templates/tdesign/spa/src/home/views/site/ContactView.vue
+++ b/templates/tdesign/spa/src/home/views/site/ContactView.vue
@@ -17,21 +17,21 @@
<div class="site-contact-icon"><i class="mdi mdi-map-marker-outline"></i></div>
<div class="site-contact-text">
<h3>公司地址</h3>
- <p>北京市朝阳区 · 数据中心园区</p>
+ <p>{{ boot.contactAddress || '北京市朝阳区 · 数据中心园区' }}</p>
</div>
</div>
<div class="site-contact-item">
<div class="site-contact-icon"><i class="mdi mdi-email-outline"></i></div>
<div class="site-contact-text">
<h3>服务邮箱</h3>
- <p>support@mnbt.example</p>
+ <p>{{ boot.contactEmail || 'support@mnbt.example' }}</p>
</div>
</div>
<div class="site-contact-item">
<div class="site-contact-icon"><i class="mdi mdi-headset"></i></div>
<div class="site-contact-text">
<h3>客服支持</h3>
- <p>工作日 9:00 - 21:00 · 7×24 工单系统</p>
+ <p>{{ boot.contactHours || '工作日 9:00 - 21:00 · 7×24 工单系统' }}</p>
</div>
</div>
</div>
@@ -84,6 +84,7 @@ import { MessagePlugin } from 'tdesign-vue-next'
import bg3 from '@/shared/assets/bg3.jpg'
import { submitSiteContact } from '@/home/api/site'
+const boot = window.__TD_BOOT__ || {}
const headerImage = bg3
const form = reactive({ name: '', email: '', phone: '', message: '' })
diff --git a/templates/tdesign/spa/src/home/views/site/products/ProductDetailView.vue b/templates/tdesign/spa/src/home/views/site/products/ProductDetailView.vue
index 862e95c..39be33f 100644
--- a/templates/tdesign/spa/src/home/views/site/products/ProductDetailView.vue
+++ b/templates/tdesign/spa/src/home/views/site/products/ProductDetailView.vue
@@ -34,7 +34,10 @@
</div>
<div class="site-detail-actions">
- <t-button theme="primary" size="large" @click="$router.push('/site/contact')">
+ <t-button v-if="product.link" theme="primary" size="large" @click="openProductLink">
+ 前往了解 <template #suffix><i class="mdi mdi-open-in-new"></i></template>
+ </t-button>
+ <t-button v-else theme="primary" size="large" @click="$router.push('/site/contact')">
联系我们 <template #suffix><i class="mdi mdi-send"></i></template>
</t-button>
<t-button variant="outline" size="large" @click="$router.push('/site/products')">返回产品中心</t-button>
@@ -59,18 +62,30 @@
<script setup>
import { ref, onMounted } from 'vue'
-import { useRoute } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
import bg2 from '@/shared/assets/bg2.jpg'
import { getSiteProduct } from '@/home/api/site'
import { formatDate } from '@/home/utils/format'
const headerImage = bg2
const route = useRoute()
+const router = useRouter()
const product = ref({})
const loading = ref(true)
const error = ref('')
+// 跳转产品配置的链接(http(s) 外链新窗口,站内路径路由跳转)
+function openProductLink() {
+ const link = (product.value.link || '').trim()
+ if (!link) return
+ if (/^https?:\/\//i.test(link)) {
+ window.open(link, '_blank', 'noopener')
+ } else {
+ router.push(link)
+ }
+}
+
onMounted(async () => {
const res = await getSiteProduct(route.params.id)
if (res.ok && res.data?.product) {
diff --git a/templates/tdesign/spa/src/home/views/site/products/ProductsView.vue b/templates/tdesign/spa/src/home/views/site/products/ProductsView.vue
index e3d9ca1..e592a6d 100644
--- a/templates/tdesign/spa/src/home/views/site/products/ProductsView.vue
+++ b/templates/tdesign/spa/src/home/views/site/products/ProductsView.vue
@@ -31,7 +31,7 @@
v-for="p in products"
:key="p.id"
class="site-product-card"
- @click="$router.push('/site/products/' + p.id)"
+ @click="openProduct(p)"
>
<div class="site-product-img">
<img v-if="p.image" :src="p.image" :alt="p.name" />
@@ -42,7 +42,10 @@
<p class="site-product-desc">{{ p.description }}</p>
<div class="site-product-foot">
<span class="site-product-cat">{{ p.category_name }}</span>
- <span class="site-product-more">了解更多 <i class="mdi mdi-arrow-right"></i></span>
+ <span class="site-product-more">
+ {{ p.link ? '前往了解' : '了解更多' }}
+ <i class="mdi mdi-arrow-right"></i>
+ </span>
</div>
</div>
</div>
@@ -86,6 +89,20 @@ function switchCategory(id) {
fetchProducts(id)
}
+// 卡片点击:配置了跳转链接优先跳转(http(s) 外链新窗口,站内路径路由跳转),否则进入详情页
+function openProduct(p) {
+ const link = p.link && p.link.trim()
+ if (link) {
+ if (/^https?:\/\//i.test(link)) {
+ window.open(link, '_blank', 'noopener')
+ } else {
+ router.push(link)
+ }
+ return
+ }
+ router.push('/site/products/' + p.id)
+}
+
onMounted(() => fetchProducts('all'))
</script>
diff --git a/templates/tdesign/theme.php b/templates/tdesign/theme.php
index 8143c19..e185c30 100644
--- a/templates/tdesign/theme.php
+++ b/templates/tdesign/theme.php
@@ -40,4 +40,121 @@ if (function_exists('mnbt_register_home_setting')) {
'placeholder' => '如:京公网安备11010802020266号',
'hint' => '显示在主页页脚(可选),自动添加全国公安网站备案查询链接',
]);
+
+ // 页脚简介:显示在主页页脚公司简介栏
+ mnbt_register_home_setting([
+ 'key' => 'footer_about',
+ 'label' => '页脚公司简介',
+ 'type' => 'textarea',
+ 'default' => '致力于为客户提供稳定、安全、高性能的虚拟主机与云计算服务。',
+ 'placeholder' => '显示在主页页脚公司简介栏的一句话介绍',
+ ]);
+
+ // 联系方式:主页页脚「联系方式」栏与「联系我们」页面共用
+ mnbt_register_home_setting([
+ 'key' => 'contact_qq',
+ 'label' => '客服 QQ(群号)',
+ 'type' => 'text',
+ 'default' => '994752422',
+ 'placeholder' => '如:994752422',
+ 'hint' => '显示在页脚联系方式与联系我们页面',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'contact_email',
+ 'label' => '服务邮箱',
+ 'type' => 'text',
+ 'default' => 'support@mnbt.example',
+ 'placeholder' => '如:support@example.com',
+ 'hint' => '显示在页脚联系方式与联系我们页面',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'contact_address',
+ 'label' => '公司地址',
+ 'type' => 'text',
+ 'default' => '北京市朝阳区 · 数据中心园区',
+ 'placeholder' => '如:北京市朝阳区 · 数据中心园区',
+ 'hint' => '显示在页脚联系方式与联系我们页面',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'contact_hours',
+ 'label' => '客服支持时间',
+ 'type' => 'text',
+ 'default' => '工作日 9:00 - 21:00 · 7×24 工单系统',
+ 'placeholder' => '如:工作日 9:00 - 21:00 · 7×24 工单系统',
+ 'hint' => '显示在联系我们页面客服支持栏',
+ ]);
+
+ // 关于我们页面:平台简介与配图
+ mnbt_register_home_setting([
+ 'key' => 'about_intro',
+ 'label' => '关于我们 · 平台简介',
+ 'type' => 'textarea',
+ 'default' => "MNBT 是一家面向企业和开发者的云计算服务商,专注于虚拟主机、云服务器、域名与安全防护等基础设施服务。依托高性能节点与全自动化部署体系,帮助用户以极低的成本快速上线业务。\n\n我们坚持\"稳定、安全、简单\"的产品理念,通过持续的技术迭代和完善的售后服务,已为大量个人站长与中小企业提供可靠的托管服务。",
+ 'placeholder' => '关于我们页面「平台简介」区块内容,空行分段',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'about_image',
+ 'label' => '关于我们 · 配图',
+ 'type' => 'image',
+ 'default' => '',
+ 'placeholder' => '上传或填写图片 URL(可选),未设置时显示默认占位',
+ 'hint' => '关于我们页面简介右侧的配图,建议宽高比 4:3',
+ ]);
+
+ // 首页 Banner 文字:三张轮播图各自的标题/副标题/描述(留空回退内置默认文案)
+ mnbt_register_home_setting([
+ 'key' => 'banner_title_1',
+ 'label' => 'Banner① 标题',
+ 'type' => 'text',
+ 'default' => '高性能虚拟主机',
+ 'placeholder' => '首页第一张轮播大标题',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_subtitle_1',
+ 'label' => 'Banner① 副标题',
+ 'type' => 'text',
+ 'default' => '即买即用 · 自动开通 · 秒级部署',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_desc_1',
+ 'label' => 'Banner① 描述',
+ 'type' => 'textarea',
+ 'default' => '全 SSD 存储与 BGP 多线接入,支付完成后自动开通,分钟级上线,为企业和开发者打造稳定高效的主机平台。',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_title_2',
+ 'label' => 'Banner② 标题',
+ 'type' => 'text',
+ 'default' => '专业团队支持',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_subtitle_2',
+ 'label' => 'Banner② 副标题',
+ 'type' => 'text',
+ 'default' => '7×24 小时全天候技术支持',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_desc_2',
+ 'label' => 'Banner② 描述',
+ 'type' => 'textarea',
+ 'default' => '经验丰富的运维与开发团队随时待命,从建站到运维全程护航,让您专注于业务本身。',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_title_3',
+ 'label' => 'Banner③ 标题',
+ 'type' => 'text',
+ 'default' => '企业级安全防护',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_subtitle_3',
+ 'label' => 'Banner③ 副标题',
+ 'type' => 'text',
+ 'default' => 'DDoS 清洗 · WAF 规则 · 每日备份',
+ ]);
+ mnbt_register_home_setting([
+ 'key' => 'banner_desc_3',
+ 'label' => 'Banner③ 描述',
+ 'type' => 'textarea',
+ 'default' => '内置安全防护体系与自动备份能力,SSL 一键签发,全面保障您的数据与业务安全。',
+ ]);
}