mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-11-08 03:50:50 +08:00
feat(notice): 通知菜单与配置默认值快照及对齐迁移
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use app\admin\service\InitDataAlignService;
|
||||
use app\admin\service\MenuAlignService;
|
||||
use think\console\Output;
|
||||
use think\migration\Migrator;
|
||||
|
||||
/**
|
||||
* 通知管理菜单与 notify 配置默认值对齐
|
||||
*
|
||||
* 背景:通知系统特性落地(system.notice 模块 + sysconfig notify 配置组),
|
||||
* 快照变更配套迁移——adminInitData/SystemMenu.php 追加「通知管理」菜单
|
||||
* (id=315,pid=228 系统管理组),adminInitData/SystemConfig.php 追加
|
||||
* notify 组全部键的默认值行。按 ulthon-init-data-migration.md 铁律,
|
||||
* 本迁移不硬编码任何数据副本,只调用对齐服务:
|
||||
* - MenuAlignService::align('SystemMenu'):按快照显式 id 判存补插菜单行
|
||||
* - InitDataAlignService::align():六域全量对齐(幂等安全),其中配置域
|
||||
* 按 (group, name) 只插缺失并自动刷新 sysconfig 缓存
|
||||
*
|
||||
* 幂等:phinxlog 按文件记账保证只执行一次;重放由服务内的存在性检查兜底。
|
||||
* down:数据对齐迁移不提供对称回滚(对齐只增不删,无法精确还原对齐前的
|
||||
* 用户态数据),如需回退参考 adminInitData/ 快照手工处理。
|
||||
*/
|
||||
class NoticeMenuConfigAlign extends Migrator
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
(new MenuAlignService(new Output()))->align('SystemMenu');
|
||||
|
||||
(new InitDataAlignService(new Output()))->align();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// 有意留空:见类注释 down 说明
|
||||
}
|
||||
}
|
||||
@@ -374,6 +374,125 @@ $ul_system_config = array(
|
||||
"value" => "1",
|
||||
"remark" => "是否排除静态资源访问(0=不排除,1=排除 /css/.js/.png 等扩展名)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_inmail_enable",
|
||||
"group" => "notify",
|
||||
"value" => "1",
|
||||
"remark" => "站内信通知渠道全局总闸(1=开启,0=关闭,键缺失视为开启)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_login_scene_enable",
|
||||
"group" => "notify",
|
||||
"value" => "0",
|
||||
"remark" => "管理员登录成功提醒通知(1=开启,0=关闭,默认关闭)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_email_enable",
|
||||
"group" => "notify",
|
||||
"value" => "0",
|
||||
"remark" => "邮件通知渠道总开关(1=开启,0=关闭,开启前需配置SMTP)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_smtp_host",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "SMTP服务器地址",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_smtp_port",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "SMTP端口(SSL 465/TLS 587/无加密 25)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_smtp_secure",
|
||||
"group" => "notify",
|
||||
"value" => "none",
|
||||
"remark" => "SMTP加密方式(none=无加密,ssl,tls)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_smtp_user",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "SMTP登录账号(留空则不认证)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_smtp_pass",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "SMTP登录密码或授权码",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_smtp_from",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "发件邮箱地址(缺省notice@localhost,真实发送需合法地址)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_smtp_from_name",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "邮件发件人名称",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_sms_enable",
|
||||
"group" => "notify",
|
||||
"value" => "0",
|
||||
"remark" => "短信通知开关(1=开启,0=关闭,扩展占位待对接)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_sms_sign",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "短信签名(服务商审核通过)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_sms_appid",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "短信服务商应用ID",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_sms_secret",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "短信服务商密钥",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_wechat_enable",
|
||||
"group" => "notify",
|
||||
"value" => "0",
|
||||
"remark" => "公众号模板消息通知开关(1=开启,0=关闭,扩展占位待对接)",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_wechat_appid",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "微信公众号应用ID",
|
||||
"sort" => 0,
|
||||
),
|
||||
array(
|
||||
"name" => "notify_wechat_secret",
|
||||
"group" => "notify",
|
||||
"value" => "",
|
||||
"remark" => "微信公众号应用密钥",
|
||||
"sort" => 0,
|
||||
)
|
||||
);
|
||||
return $ul_system_config;
|
||||
|
||||
@@ -323,6 +323,18 @@ $ul_system_menu = array(
|
||||
"sort" => 3,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 315,
|
||||
"pid" => 228,
|
||||
"title" => "通知管理",
|
||||
"icon" => "fa fa-bell-o",
|
||||
"href" => "system.notice/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"auth_node" => "system.notice/index",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user