2 lines
36 KiB
JavaScript
2 lines
36 KiB
JavaScript
import{_ as t,o as l,c as o,a2 as a}from"./chunks/framework.B-QBKwc1.js";const u=JSON.parse('{"title":"更新日志","description":"更新日志是项目演进的完整记录,帮助开发者和企业了解每个版本的能力变化与技术演进方向。","frontmatter":{},"headers":[],"relativePath":"zh/changelog.md","filePath":"zh/changelog.md"}'),i={name:"zh/changelog.md"};function r(n,e,d,s,c,h){return l(),o("div",null,[...e[0]||(e[0]=[a('<h1 id="_1-6-更新日志" tabindex="-1">1.6 更新日志 <a class="header-anchor" href="#_1-6-更新日志" aria-label="Permalink to "1.6 更新日志""></a></h1><div class="tip custom-block"><p class="custom-block-title">说明</p><p>更新日志是项目演进的完整记录,帮助开发者和企业了解每个版本的能力变化与技术演进方向。对于开发者,可快速掌握新功能与 API 变更,降低升级成本;对于企业,可评估版本稳定性与功能成熟度,为技术选型和升级决策提供依据。建议在升级前阅读目标版本的变更内容,确保业务代码平滑适配。</p></div><h2 id="版本总览" tabindex="-1">版本总览 <a class="header-anchor" href="#版本总览" aria-label="Permalink to "版本总览""></a></h2><table tabindex="0"><thead><tr><th style="text-align:left;">版本</th><th style="text-align:left;">日期</th><th style="text-align:left;">主要内容</th></tr></thead><tbody><tr><td style="text-align:left;"><strong>5.0.0</strong></td><td style="text-align:left;"><strong>2026-10-01</strong></td><td style="text-align:left;"><strong>正式稳定版发布</strong></td></tr><tr><td style="text-align:left;">4.9.0</td><td style="text-align:left;">2026-06-18</td><td style="text-align:left;">OAuth2 认证与令牌管理</td></tr><tr><td style="text-align:left;">4.8.0</td><td style="text-align:left;">2026-04-06</td><td style="text-align:left;">安全加固与防护增强</td></tr><tr><td style="text-align:left;">4.7.0</td><td style="text-align:left;">2026-01-13</td><td style="text-align:left;">扩展业务模块</td></tr><tr><td style="text-align:left;">4.6.0</td><td style="text-align:left;">2025-11-25</td><td style="text-align:left;">数据处理与文件管理</td></tr><tr><td style="text-align:left;">4.5.0</td><td style="text-align:left;">2025-09-16</td><td style="text-align:left;">代码生成器增强</td></tr><tr><td style="text-align:left;">4.4.0</td><td style="text-align:left;">2025-08-07</td><td style="text-align:left;">性能优化与缓存策略</td></tr><tr><td style="text-align:left;">4.3.0</td><td style="text-align:left;">2025-06-21</td><td style="text-align:left;">Excel 导入导出</td></tr><tr><td style="text-align:left;">4.2.0</td><td style="text-align:left;">2025-05-09</td><td style="text-align:left;">操作日志与审计增强</td></tr><tr><td style="text-align:left;">4.1.0</td><td style="text-align:left;">2025-03-28</td><td style="text-align:left;">服务层抽离与注解体系</td></tr><tr><td style="text-align:left;">4.0.0</td><td style="text-align:left;">2025-02-14</td><td style="text-align:left;">架构重构:声明式 CRUD 体系</td></tr><tr><td style="text-align:left;">3.9.0</td><td style="text-align:left;">2024-12-22</td><td style="text-align:left;">代码生成器</td></tr><tr><td style="text-align:left;">3.8.0</td><td style="text-align:left;">2024-10-17</td><td style="text-align:left;">多租户架构与数据隔离</td></tr><tr><td style="text-align:left;">3.7.0</td><td style="text-align:left;">2024-09-03</td><td style="text-align:left;">定时任务调度系统</td></tr><tr><td style="text-align:left;">3.6.0</td><td style="text-align:left;">2024-07-26</td><td style="text-align:left;">通知公告与友情链接</td></tr><tr><td style="text-align:left;">3.5.0</td><td style="text-align:left;">2024-06-11</td><td style="text-align:left;">内容管理(文章/分类)</td></tr><tr><td style="text-align:left;">3.4.0</td><td style="text-align:left;">2024-04-19</td><td style="text-align:left;">字典与配置管理系统</td></tr><tr><td style="text-align:left;">3.3.0</td><td style="text-align:left;">2024-03-05</td><td style="text-align:left;">部门菜单与数据权限控制</td></tr><tr><td style="text-align:left;">3.2.0</td><td style="text-align:left;">2024-01-23</td><td style="text-align:left;">用户管理与 RBAC 权限体系</td></tr><tr><td style="text-align:left;">3.1.0</td><td style="text-align:left;">2023-12-08</td><td style="text-align:left;">JWT 双令牌认证与登录体系</td></tr><tr><td style="text-align:left;">3.0.0</td><td style="text-align:left;">2023-10-12</td><td style="text-align:left;">项目初始化,基础架构框架搭建</td></tr></tbody></table><h2 id="-5-0-0-2026-10-01" tabindex="-1">[5.0.0] - 2026-10-01 <a class="header-anchor" href="#-5-0-0-2026-10-01" aria-label="Permalink to "[5.0.0] - 2026-10-01""></a></h2><p><strong>正式稳定版发布,全面完善文档、安全加固与生产环境适配。</strong></p><h3 id="新增" tabindex="-1">新增 <a class="header-anchor" href="#新增" aria-label="Permalink to "新增""></a></h3><ul><li><strong>自动参数校验</strong>:Service 层配置验证请求类后,<code>add</code>/<code>update</code> 自动调用 FormRequest 校验,覆盖所有 CRUD 入口(含导入),全模块验证器覆盖率 100%</li><li><strong>项目文档体系</strong>:VitePress 开发者文档站点全面改版,覆盖快速入门、模块开发、架构设计、运维部署全场景</li><li><strong>多数据库初始化脚本</strong>:MySQL / PostgreSQL / SQL Server / Oracle / SQLite 五套完整建表脚本(<code>document/</code> 按数据库类型分组,已做对应 SQL 语法适配)</li><li><strong>生产环境部署指南</strong>:Docker 容器化支持,提供 Dockerfile + docker-compose.yml 一键部署(Nginx + PHP-FPM + MySQL + Redis 四容器编排)</li><li><strong>系统健康检查接口</strong>:<code>/up</code> 健康路由,运行状态监控,服务可用性实时检测</li><li><strong>跨库迁移工具</strong>:<code>php artisan db:migrate</code> 数据结构与数据跨数据库迁移</li></ul><h3 id="优化" tabindex="-1">优化 <a class="header-anchor" href="#优化" aria-label="Permalink to "优化""></a></h3><ul><li><strong>IP 归属地查询</strong>:基于 <code>zoujingli/ip2region</code>(v3.0+)composer 包,支持 IPv4/IPv6,自动加载内置数据库</li><li><strong>新增 ProxyMiddleware 全局中间件</strong>:部署在 CDN / 负载均衡后面时,自动从 <code>X-Forwarded-For</code> / <code>X-Real-IP</code> 头提取真实客户端 IP,通过 <code>.env</code> 的 <code>TRUSTED_PROXIES</code> 配置受信代理</li><li><strong>角色模块多租户改造</strong>:角色表新增 <code>tenant_id</code> 字段,角色数据按租户隔离,RoleService 改为继承 BaseTenantService</li><li>全模块稳定性测试与边界条件覆盖</li><li>错误提示信息统一规范化,提升用户友好度</li><li>日志输出格式标准化,便于日志采集与分析</li><li>依赖包版本锁定(composer.lock),确保生产环境一致性</li><li>接口限流策略优化,防止恶意请求</li></ul><h3 id="修复" tabindex="-1">修复 <a class="header-anchor" href="#修复" aria-label="Permalink to "修复""></a></h3><ul><li>JWT 密钥强制从环境变量读取,禁止硬编码,启动时 fail-close 校验(不足 32 字符拒绝启动)</li><li>敏感配置项统一迁移至 <code>.env</code> 文件</li><li>CORS 配置支持环境变量动态指定允许域名</li></ul><h2 id="-4-9-0-2026-06-18" tabindex="-1">[4.9.0] - 2026-06-18 <a class="header-anchor" href="#-4-9-0-2026-06-18" aria-label="Permalink to "[4.9.0] - 2026-06-18""></a></h2><p><strong>OAuth2 认证与令牌管理增强。</strong></p><h3 id="新增-1" tabindex="-1">新增 <a class="header-anchor" href="#新增-1" aria-label="Permalink to "新增""></a></h3><ul><li><strong>OAuth2 完整认证流程</strong>:Token 签发 / 刷新 / 吊销 / 检测,兼容标准 OAuth2 协议(<code>AuthController::token</code> / <code>removeToken</code> / <code>checkToken</code>)</li><li><strong>令牌 Redis 黑名单机制</strong>:登出后令牌即时失效,防止令牌被盗用</li><li><strong>密码强度校验策略</strong>:长度、复杂度、常见密码库校验</li><li><strong>登录日志增强</strong>:增加 IP 归属地与浏览器信息记录</li></ul><h3 id="优化-1" tabindex="-1">优化 <a class="header-anchor" href="#优化-1" aria-label="Permalink to "优化""></a></h3><ul><li>JWT access_token 有效期可配置化(<code>JWT_ACCESS_TTL</code>,默认 2 小时)</li><li>refresh_token 续签逻辑优化,支持滑动过期</li><li>验证码生成算法升级,增加干扰线与噪点</li><li>登录失败次数限制与账户锁定机制</li></ul><h2 id="-4-8-0-2026-04-06" tabindex="-1">[4.8.0] - 2026-04-06 <a class="header-anchor" href="#-4-8-0-2026-04-06" aria-label="Permalink to "[4.8.0] - 2026-04-06""></a></h2><p><strong>安全加固与防护增强。</strong></p><h3 id="新增-2" tabindex="-1">新增 <a class="header-anchor" href="#新增-2" aria-label="Permalink to "新增""></a></h3><ul><li><strong>XSS 防护增强</strong>:富文本内容过滤策略优化,白名单机制</li><li><strong>CORS 配置增强</strong>:支持环境变量动态指定允许域名,凭证模式兼容</li><li><strong>演示模式增强</strong>:<code>#[DemoAllow]</code> 注解精细化控制,指定接口放行(DemoMiddleware)</li></ul><h3 id="优化-2" tabindex="-1">优化 <a class="header-anchor" href="#优化-2" aria-label="Permalink to "优化""></a></h3><ul><li>敏感配置项统一迁移至 <code>.env</code> 文件,禁止硬编码</li><li>请求参数统一校验,FormRequest 空参数与类型错误提前拦截</li><li>异常信息脱敏,生产环境(<code>APP_DEBUG=false</code>)不暴露文件路径与行号</li></ul><h3 id="修复-1" tabindex="-1">修复 <a class="header-anchor" href="#修复-1" aria-label="Permalink to "修复""></a></h3><ul><li>修复并发请求下会话数据串扰问题</li><li>修复文件上传超大文件未中断导致内存溢出</li><li>修复特殊字符参数未转义导致的解析异常</li></ul><h2 id="-4-7-0-2026-01-13" tabindex="-1">[4.7.0] - 2026-01-13 <a class="header-anchor" href="#-4-7-0-2026-01-13" aria-label="Permalink to "[4.7.0] - 2026-01-13""></a></h2><p><strong>扩展业务模块,覆盖更多管理场景。</strong></p><h3 id="新增-3" tabindex="-1">新增 <a class="header-anchor" href="#新增-3" aria-label="Permalink to "新增""></a></h3><ul><li><strong>岗位管理模块</strong>:岗位信息维护与部门关联(PositionController / PositionService)</li><li><strong>系统参数管理模块</strong>:系统参数与业务参数分类管理(ParamController / ParamService)</li><li><strong>职级管理模块</strong>:职级信息维护与排序,支持 Excel 导入导出(LevelController / LevelService)</li><li><strong>城市行政区划模块</strong>:城市树形结构与模糊搜索(CityController / CityService)</li></ul><h3 id="优化-3" tabindex="-1">优化 <a class="header-anchor" href="#优化-3" aria-label="Permalink to "优化""></a></h3><ul><li>参数管理支持缓存策略,高频参数请求级缓存</li><li>城市数据支持树形结构展示与模糊搜索</li><li>岗位与部门关联查询优化</li><li>字段校验统一规范化(新增对应 FormRequest)</li></ul><h2 id="-4-6-0-2025-11-25" tabindex="-1">[4.6.0] - 2025-11-25 <a class="header-anchor" href="#-4-6-0-2025-11-25" aria-label="Permalink to "[4.6.0] - 2025-11-25""></a></h2><p><strong>数据处理能力与文件管理全面增强。</strong></p><h3 id="新增-4" tabindex="-1">新增 <a class="header-anchor" href="#新增-4" aria-label="Permalink to "新增""></a></h3><ul><li><strong>文件模板管理模块</strong>:模板文件上传、版本管理与在线编辑(FileTemplateController / FileTemplateService)</li><li><strong>富文本占位符机制</strong>:<code>[IMG_URL]</code> 占位符,入库替换、出库还原域名,迁移无感知</li><li><strong>文件字段自动迁移</strong>:临时文件自动迁移至正式目录,自动去除域名前缀(HasFileProcessing Trait)</li><li><strong>批量导出分批查询</strong>:支持逐批处理,避免大数据量内存溢出</li></ul><h3 id="优化-4" tabindex="-1">优化 <a class="header-anchor" href="#优化-4" aria-label="Permalink to "优化""></a></h3><ul><li>全局辅助函数文件处理链路优化(<code>save_file</code> / <code>get_file_url</code> 等)</li><li>文件上传 MIME 类型真实检测(<code>finfo</code>),不信任客户端声明</li><li>上传目录自动按日期分目录,避免单目录文件过多</li><li>图片字段与文件字段处理逻辑分离,支持不同校验策略</li></ul><h2 id="-4-5-0-2025-09-16" tabindex="-1">[4.5.0] - 2025-09-16 <a class="header-anchor" href="#-4-5-0-2025-09-16" aria-label="Permalink to "[4.5.0] - 2025-09-16""></a></h2><p><strong>代码生成器功能增强与模板优化。</strong></p><h3 id="新增-5" tabindex="-1">新增 <a class="header-anchor" href="#新增-5" aria-label="Permalink to "新增""></a></h3><ul><li><strong>批量生成</strong>:支持多表批量生成代码,一次操作完成多模块搭建</li><li><strong>代码预览</strong>:生成前可查看所有文件内容,确认无误后再写入</li><li><strong>字典自动生成</strong>:从字段注释中提取枚举值,自动生成字典数据</li><li><strong>路由与菜单自动生成</strong>:生成代码时自动注册 <code>routes/api.php</code> 路由与菜单权限节点</li></ul><h3 id="优化-5" tabindex="-1">优化 <a class="header-anchor" href="#优化-5" aria-label="Permalink to "优化""></a></h3><ul><li>模板渲染引擎优化,变量替换更精准(<code>resources/templates/</code> 后端 4 套 + 前端 ui/ui2 模板)</li><li>字段属性自动分析(图片字段、富文本字段、筛选字段、模糊搜索字段)</li><li>生成文件冲突检测,已存在文件提示跳过或覆盖</li><li>多数据库驱动适配优化(PostgreSQL / SQL Server / SQLite)</li></ul><h2 id="-4-4-0-2025-08-07" tabindex="-1">[4.4.0] - 2025-08-07 <a class="header-anchor" href="#-4-4-0-2025-08-07" aria-label="Permalink to "[4.4.0] - 2025-08-07""></a></h2><p><strong>性能优化与缓存策略升级。</strong></p><h3 id="新增-6" tabindex="-1">新增 <a class="header-anchor" href="#新增-6" aria-label="Permalink to "新增""></a></h3><ul><li><strong>查询参数自动转换</strong>:驼峰转下划线自动转换(<code>API_CAMEL_SNAKE_CONVERT</code>),前后端命名风格无感适配</li><li><strong>动态排序</strong>:排序字段支持前端动态指定(排序白名单内生效)</li><li><strong>返回字段过滤</strong>:前端通过 <code>fields</code> 参数指定需要的字段,减少数据传输量</li><li><strong>分批查询回调</strong>:支持逐批回调处理,适合大数据量导出</li></ul><h3 id="优化-6" tabindex="-1">优化 <a class="header-anchor" href="#优化-6" aria-label="Permalink to "优化""></a></h3><ul><li>数据权限查询缓存(角色权限缓存,Menu/RoleMenu Observer 失效)</li><li>字典数据请求级缓存 + Cache 两级缓存,同一请求内不重复查询</li><li>系统参数请求级缓存,减少数据库查询</li><li>表字段列表静态缓存,同一请求内只查一次</li></ul><h2 id="-4-3-0-2025-06-21" tabindex="-1">[4.3.0] - 2025-06-21 <a class="header-anchor" href="#-4-3-0-2025-06-21" aria-label="Permalink to "[4.3.0] - 2025-06-21""></a></h2><p><strong>Excel 导入导出功能上线。</strong></p><h3 id="新增-7" tabindex="-1">新增 <a class="header-anchor" href="#新增-7" aria-label="Permalink to "新增""></a></h3><ul><li><strong>Excel 导入</strong>:支持原始数组导入与表头映射导入两种模式(<code>ExcelService::import</code> / <code>importWithMap</code>)</li><li><strong>Excel 导出</strong>:一次性导出,适合中小数据量(<code>ExcelService::export</code>)</li><li><strong>大数据量分批导出</strong>:分批查询 + 流式写入,避免内存溢出</li><li><strong>表头映射导入</strong>:自动按表头关联字段名,无需手动映射列号</li></ul><h3 id="优化-7" tabindex="-1">优化 <a class="header-anchor" href="#优化-7" aria-label="Permalink to "优化""></a></h3><ul><li>导出文件统一保存至临时目录,自动清理过期文件</li><li>导入数据空行自动过滤</li><li>PhpSpreadsheet 依赖升级至 ^2.0</li><li>导入导出异常统一捕获,返回友好错误信息</li></ul><h2 id="-4-2-0-2025-05-09" tabindex="-1">[4.2.0] - 2025-05-09 <a class="header-anchor" href="#-4-2-0-2025-05-09" aria-label="Permalink to "[4.2.0] - 2025-05-09""></a></h2><p><strong>操作日志与审计体系全面增强。</strong></p><h3 id="新增-8" tabindex="-1">新增 <a class="header-anchor" href="#新增-8" aria-label="Permalink to "新增""></a></h3><ul><li><strong>30 种操作类型常量</strong>:<code>#[OperationLog]</code> 注解支持新增/修改/删除/查询/导入/导出/审批/驳回/执行/暂停/恢复等全场景</li><li><strong>日志描述占位符</strong>:支持 <code>{param}</code> 占位符,自动替换为请求参数值(如 <code>删除用户ID:{id}</code> → <code>删除用户ID:123</code>)</li><li><strong>智能记录策略</strong>:写操作(POST/PUT/DELETE)始终记录,读操作按类型选择性记录</li><li><strong>登录日志独立模块</strong>:记录登录/登出/失败,含失败原因与 IP 信息</li></ul><h3 id="优化-8" tabindex="-1">优化 <a class="header-anchor" href="#优化-8" aria-label="Permalink to "优化""></a></h3><ul><li>LogOperation 中间件日志写入失败静默处理,不影响主业务(terminable 阶段落库)</li><li>操作日志排除列表可配置化</li><li>OperationLog 模型增加操作类型名称自动翻译</li><li>日志记录增加耗时统计(请求开始到响应完成)</li></ul><h2 id="-4-1-0-2025-03-28" tabindex="-1">[4.1.0] - 2025-03-28 <a class="header-anchor" href="#-4-1-0-2025-03-28" aria-label="Permalink to "[4.1.0] - 2025-03-28""></a></h2><p><strong>服务层抽离与 PHP 8 注解体系。</strong></p><h3 id="新增-9" tabindex="-1">新增 <a class="header-anchor" href="#新增-9" aria-label="Permalink to "新增""></a></h3><ul><li><strong><code>#[Permission]</code> 权限注解</strong>:控制器方法级权限校验,auth.jwt 中间件反射统一鉴权,声明即生效</li><li><strong><code>#[OperationLog]</code> 操作日志注解</strong>:自动记录操作日志,无需手动埋点</li><li><strong><code>#[DemoAllow]</code> 演示模式注解</strong>:演示模式下指定接口放行</li><li><strong><code>PasswordService</code></strong>:密码加密服务(bcrypt,成本因子 12)</li><li><strong><code>RequestInfoService</code></strong>:请求信息提取服务(IP / User-Agent / 地理位置)</li></ul><h3 id="优化-9" tabindex="-1">优化 <a class="header-anchor" href="#优化-9" aria-label="Permalink to "优化""></a></h3><ul><li>权限码统一命名规范:<code>sys:{模块名}:{操作}</code>(如 <code>sys:user:add</code>)</li><li>超级管理员(uid=1)权限校验直接放行</li><li>注解支持类级回退(<code>Permission</code> 注解可标注在类上)</li></ul><h2 id="-4-0-0-2025-02-14" tabindex="-1">[4.0.0] - 2025-02-14 <a class="header-anchor" href="#-4-0-0-2025-02-14" aria-label="Permalink to "[4.0.0] - 2025-02-14""></a></h2><p><strong>架构重构 — 声明式 CRUD 体系,大幅减少重复代码。</strong></p><h3 id="新增-10" tabindex="-1">新增 <a class="header-anchor" href="#新增-10" aria-label="Permalink to "新增""></a></h3><ul><li><strong>声明式属性配置</strong>:<code>BaseService</code> 通过配置 <code>pageLikeFields</code> / <code>pageEqFields</code> / <code>pageOrderBy</code> / <code>uniqueFields</code> 等属性,自动完成查询构建、排序、唯一性校验</li><li><strong>生命周期钩子体系</strong>:<code>beforeAdd</code> / <code>afterAdd</code> / <code>beforeUpdate</code> / <code>afterUpdate</code> / <code>beforeDelete</code> / <code>afterDelete</code>,业务逻辑按需注入,DB 事务由基类统一管理</li><li><strong>6 个 Service Trait</strong>:HasCrudOperations / HasQueryScopes / HasFileProcessing / HasDataScope / HasSerializeMaps / HasUniqueCheck 组合复用</li><li><strong>文件字段自动处理</strong>:配置 <code>fileFields</code> 后自动迁移临时文件、补全域名</li><li><strong>富文本字段自动处理</strong>:配置 <code>contentFields</code> 后自动处理临时文件与占位符</li><li><strong>枚举显示名自动翻译</strong>:配置 <code>serializeMaps</code> 后自动补 <code>{字段名}Text</code> 字段</li><li><strong>唯一性校验机制</strong>:配置 <code>uniqueFields</code> 后自动校验</li></ul><h3 id="优化-10" tabindex="-1">优化 <a class="header-anchor" href="#优化-10" aria-label="Permalink to "优化""></a></h3><ul><li><code>Controller</code> 基类提供 <code>_page</code> / <code>_list</code> / <code>_treeList</code> / <code>_detail</code> / <code>_add</code> / <code>_update</code> / <code>_delete</code> / <code>_batchDelete</code> 通用方法</li><li>子类控制器代码量减少 70%+,只需配置属性 + 调用父类方法</li><li><code>HasAuditColumns</code> 审计字段自动写入(<code>create_user</code> / <code>create_time</code> / <code>update_user</code> / <code>update_time</code>)</li><li><code>SoftDeleteFlagScope</code> 软删除全局查询范围自动过滤已删除数据</li></ul><h3 id="修复-2" tabindex="-1">修复 <a class="header-anchor" href="#修复-2" aria-label="Permalink to "修复""></a></h3><ul><li>修复批量软删除未关闭全局作用域导致条件叠加的问题</li><li>修复富文本内容中域名替换不完整的问题</li><li>修复驼峰/下划线转换中数组嵌套场景的边界问题</li></ul><h2 id="-3-9-0-2024-12-22" tabindex="-1">[3.9.0] - 2024-12-22 <a class="header-anchor" href="#-3-9-0-2024-12-22" aria-label="Permalink to "[3.9.0] - 2024-12-22""></a></h2><p><strong>代码生成器上线,开发效率质的飞跃。</strong></p><h3 id="新增-11" tabindex="-1">新增 <a class="header-anchor" href="#新增-11" aria-label="Permalink to "新增""></a></h3><ul><li><strong>代码生成器模块</strong>:一键生成 Controller / Service / Model / FormRequest / 前端页面(GeneratorController / GeneratorService)</li><li><strong>CLI 命令</strong>:<code>php artisan generate:code</code> 命令行生成</li><li><strong>数据表列表查询</strong>:从数据库读取所有表信息,支持按表名搜索</li><li><strong>表结构分析</strong>:字段类型归一化与属性自动识别(图片、富文本、筛选项、唯一、模糊搜索)</li></ul><h3 id="优化-11" tabindex="-1">优化 <a class="header-anchor" href="#优化-11" aria-label="Permalink to "优化""></a></h3><ul><li>生成代码风格与项目现有代码保持一致</li><li>生成的 FormRequest 自动按字段类型生成校验规则</li><li>生成的 Controller 自动配置 <code>#[Permission]</code> 与 <code>#[OperationLog]</code> 注解</li><li>生成的菜单自动挂载到指定父菜单下(<code>GENERATOR_PARENT_MENU_ID</code>)</li></ul><h2 id="-3-8-0-2024-10-17" tabindex="-1">[3.8.0] - 2024-10-17 <a class="header-anchor" href="#-3-8-0-2024-10-17" aria-label="Permalink to "[3.8.0] - 2024-10-17""></a></h2><p><strong>多租户架构,支持 SaaS 化部署。</strong></p><h3 id="新增-12" tabindex="-1">新增 <a class="header-anchor" href="#新增-12" aria-label="Permalink to "新增""></a></h3><ul><li><strong>租户管理模块</strong>:租户 CRUD、用户数统计、管理员账号创建(TenantController / TenantService)</li><li><strong><code>ResolveTenant</code> 租户中间件</strong>:从 JWT 解析用户租户,注入租户上下文</li><li><strong><code>BaseTenantService</code> 租户隔离</strong>:自动按租户过滤查询数据,新增数据自动填充 <code>tenant_id</code></li><li><strong>租户状态校验</strong>:启用/禁用/过期三种状态,过期租户自动拒绝访问</li><li><strong><code>config/tenant.php</code></strong> 租户配置文件(默认租户 ID)</li></ul><h3 id="优化-12" tabindex="-1">优化 <a class="header-anchor" href="#优化-12" aria-label="Permalink to "优化""></a></h3><ul><li>超级管理员(<code>tenantId=0</code>)跳过租户隔离,创建数据代入默认租户</li><li>租户信息缓存,减少重复查询</li></ul><h2 id="-3-7-0-2024-09-03" tabindex="-1">[3.7.0] - 2024-09-03 <a class="header-anchor" href="#-3-7-0-2024-09-03" aria-label="Permalink to "[3.7.0] - 2024-09-03""></a></h2><p><strong>定时任务调度系统,支持可视化管理。</strong></p><h3 id="新增-13" tabindex="-1">新增 <a class="header-anchor" href="#新增-13" aria-label="Permalink to "新增""></a></h3><ul><li><strong>定时任务管理</strong>:任务 CRUD、Cron 表达式配置、启用/禁用(JobController / JobService)</li><li><strong>任务执行日志</strong>:完整记录每次执行的开始时间、结束时间、执行状态、耗时、错误详情(JobLogController / JobLogService)</li><li><strong>Daemon 常驻进程调度器</strong>:<code>php artisan job:daemon</code> 后台常驻进程自动调度任务执行</li><li><strong>一次性执行</strong>:<code>php artisan job:run</code> 配合系统 Cron 执行到期任务</li><li><strong>任务操作</strong>:手动执行一次、暂停、恢复、启用/禁用</li></ul><h3 id="优化-13" tabindex="-1">优化 <a class="header-anchor" href="#优化-13" aria-label="Permalink to "优化""></a></h3><ul><li>任务防重复执行机制(同一任务同一分钟内不重复执行)</li><li>跨平台进程检测(Windows <code>tasklist</code> / Linux <code>posix_kill</code>)</li><li>任务执行异常捕获与日志记录</li><li>Cron 表达式校验与解析</li></ul><h2 id="-3-6-0-2024-07-26" tabindex="-1">[3.6.0] - 2024-07-26 <a class="header-anchor" href="#-3-6-0-2024-07-26" aria-label="Permalink to "[3.6.0] - 2024-07-26""></a></h2><p><strong>通知公告与友情链接模块。</strong></p><h3 id="新增-14" tabindex="-1">新增 <a class="header-anchor" href="#新增-14" aria-label="Permalink to "新增""></a></h3><ul><li><strong>通知公告模块</strong>:通知 CRUD、类型管理、发布状态、排序(NoticeController / NoticeService)</li><li><strong>友情链接模块</strong>:链接 CRUD、图标管理、启用/禁用(LinkController / LinkService)</li><li><strong>通知类型字典</strong>:通知/公告/提醒三种类型,字典驱动</li><li><strong>链接状态管理</strong>:启用/禁用状态控制</li></ul><h3 id="优化-14" tabindex="-1">优化 <a class="header-anchor" href="#优化-14" aria-label="Permalink to "优化""></a></h3><ul><li>通知内容支持富文本编辑</li><li>通知发布状态与排序管理</li><li>链接图标与描述字段扩展</li><li>列表查询支持状态筛选与模糊搜索</li></ul><h2 id="-3-5-0-2024-06-11" tabindex="-1">[3.5.0] - 2024-06-11 <a class="header-anchor" href="#-3-5-0-2024-06-11" aria-label="Permalink to "[3.5.0] - 2024-06-11""></a></h2><p><strong>内容管理模块上线。</strong></p><h3 id="新增-15" tabindex="-1">新增 <a class="header-anchor" href="#新增-15" aria-label="Permalink to "新增""></a></h3><ul><li><strong>文章管理模块</strong>:文章 CRUD、封面图、图集、状态管理、点击率统计(ArticleController / ArticleService)</li><li><strong>文章分类模块</strong>:分类 CRUD、树形结构、多级嵌套(CategoryController / CategoryService)</li><li><strong>分类树形结构</strong>:支持无限级分类嵌套(<code>parent_id</code> 自关联)</li><li><strong>文章状态管理</strong>:正常/下架两种状态</li></ul><h3 id="优化-15" tabindex="-1">优化 <a class="header-anchor" href="#优化-15" aria-label="Permalink to "优化""></a></h3><ul><li>分类编码唯一性校验</li><li>文章内容支持富文本编辑器</li><li>文章排序与置顶功能</li><li>分类支持模糊搜索与树形展示</li></ul><h2 id="-3-4-0-2024-04-19" tabindex="-1">[3.4.0] - 2024-04-19 <a class="header-anchor" href="#-3-4-0-2024-04-19" aria-label="Permalink to "[3.4.0] - 2024-04-19""></a></h2><p><strong>字典与配置管理,系统基础数据标准化。</strong></p><h3 id="新增-16" tabindex="-1">新增 <a class="header-anchor" href="#新增-16" aria-label="Permalink to "新增""></a></h3><ul><li><strong>字典管理模块</strong>:字典 CRUD、字典项管理(DictController / DictItemController / DictService)</li><li><strong>配置管理模块</strong>:配置 CRUD、配置项管理(ConfigController / ConfigItemController / ConfigService)</li><li><strong><code>DictCacheService</code> 字典服务</strong>:按编码查询字典值,两级缓存(请求级 + Cache)</li><li><strong><code>ParamService</code> 参数服务</strong>:按编码查询系统参数,请求级缓存</li><li><strong>字典缓存命令</strong>:<code>php artisan dict:clear-cache</code></li></ul><h3 id="优化-16" tabindex="-1">优化 <a class="header-anchor" href="#优化-16" aria-label="Permalink to "优化""></a></h3><ul><li>字典数据按编码缓存,同一请求内不重复查询</li><li>配置项支持分组管理</li><li>字典值与显示名自动映射(Observer 变更自动失效缓存)</li><li>配置项支持启用/禁用状态</li></ul><h2 id="-3-3-0-2024-03-05" tabindex="-1">[3.3.0] - 2024-03-05 <a class="header-anchor" href="#-3-3-0-2024-03-05" aria-label="Permalink to "[3.3.0] - 2024-03-05""></a></h2><p><strong>部门菜单与数据权限体系。</strong></p><h3 id="新增-17" tabindex="-1">新增 <a class="header-anchor" href="#新增-17" aria-label="Permalink to "新增""></a></h3><ul><li><strong>部门管理模块</strong>:部门 CRUD、树形结构(DeptController / DeptService)</li><li><strong>菜单管理模块</strong>:菜单 CRUD、目录/菜单/按钮三种类型(MenuController / MenuService)</li><li><strong>数据权限控制</strong>:全部 / 本部门 / 仅本人三级数据权限</li><li><strong><code>HasDataScope</code> 数据权限 Trait</strong>:配置数据权限字段后自动过滤</li><li><strong>角色数据权限范围</strong>:<code>data_scope</code> 字段控制角色可见数据范围</li></ul><h3 id="优化-17" tabindex="-1">优化 <a class="header-anchor" href="#优化-17" aria-label="Permalink to "优化""></a></h3><ul><li>菜单支持目录 / 菜单 / 按钮三种类型(<code>type</code> 字段)</li><li>权限节点与菜单分离,按钮级权限控制</li><li>部门树形结构展示</li><li>数据权限缓存机制(角色权限缓存 + Observer 失效)</li></ul><h2 id="-3-2-0-2024-01-23" tabindex="-1">[3.2.0] - 2024-01-23 <a class="header-anchor" href="#-3-2-0-2024-01-23" aria-label="Permalink to "[3.2.0] - 2024-01-23""></a></h2><p><strong>用户管理与角色权限体系。</strong></p><h3 id="新增-18" tabindex="-1">新增 <a class="header-anchor" href="#新增-18" aria-label="Permalink to "新增""></a></h3><ul><li><strong>用户管理模块</strong>:用户 CRUD、密码重置、启用/禁用(UserController / UserService)</li><li><strong>角色管理模块</strong>:角色 CRUD、权限节点配置(RoleController / RoleService)</li><li><strong>RBAC 权限模型</strong>:用户 → 角色 → 菜单 → 权限,菜单即权限体系</li><li><strong>用户角色关联表</strong>:<code>UserRole</code> 支持一个用户多角色</li><li><strong>角色菜单关联表</strong>:<code>RoleMenu</code> 支持一个角色多权限</li></ul><h3 id="优化-18" tabindex="-1">优化 <a class="header-anchor" href="#优化-18" aria-label="Permalink to "优化""></a></h3><ul><li>用户密码 bcrypt 加密(成本因子 12)</li><li>用户状态管理(启用/禁用)</li><li>角色支持权限节点批量分配</li><li>用户列表支持按角色、部门筛选</li></ul><h2 id="-3-1-0-2023-12-08" tabindex="-1">[3.1.0] - 2023-12-08 <a class="header-anchor" href="#-3-1-0-2023-12-08" aria-label="Permalink to "[3.1.0] - 2023-12-08""></a></h2><p><strong>用户认证与 JWT 双令牌体系。</strong></p><h3 id="新增-19" tabindex="-1">新增 <a class="header-anchor" href="#新增-19" aria-label="Permalink to "新增""></a></h3><ul><li><strong>用户登录接口</strong>:用户名 + 密码 + 验证码登录(<code>AuthController::login</code>)</li><li><strong>JWT 双令牌机制</strong>:<code>access_token</code>(默认 2 小时) + <code>refresh_token</code>(默认 7 天)</li><li><strong><code>JwtService</code> 令牌服务</strong>:令牌签发 / 刷新 / 解析 / 吊销(Redis 有状态存储)</li><li><strong>图形验证码</strong>:<code>CaptchaService</code> 生成验证码,按 IP 频率控制</li><li><strong><code>Authenticate</code> 认证中间件(auth.jwt)</strong>:JWT 校验 + <code>#[Permission]</code> 鉴权 + 用户信息注入</li><li><strong><code>Cors</code> 跨域中间件</strong>:支持配置化跨域策略</li></ul><h3 id="优化-19" tabindex="-1">优化 <a class="header-anchor" href="#优化-19" aria-label="Permalink to "优化""></a></h3><ul><li>Token 从请求头 <code>Authorization: Bearer {token}</code> 提取</li><li>登录参数 FormRequest 校验</li><li>登录日志记录(成功/失败/原因)</li></ul><h2 id="-3-0-0-2023-10-12" tabindex="-1">[3.0.0] - 2023-10-12 <a class="header-anchor" href="#-3-0-0-2023-10-12" aria-label="Permalink to "[3.0.0] - 2023-10-12""></a></h2><p><strong>项目初始化,搭建基础架构框架。</strong></p><h3 id="新增-20" tabindex="-1">新增 <a class="header-anchor" href="#新增-20" aria-label="Permalink to "新增""></a></h3><ul><li><strong>Laravel 13 框架初始化</strong>:基于 Laravel 13 + PHP 8.3 搭建前后端分离 API 项目</li><li><strong>模型层基础</strong>:Eloquent 模型 + <code>SoftDeletesByFlag</code>(<code>is_delete</code> 软删除) + <code>HasAuditColumns</code>(审计字段自动写入)</li><li><strong>控制器基类</strong>:统一响应格式(<code>success</code> / <code>fail</code> / <code>paginate</code>)+ 参数获取 + 通用 CRUD 快捷方法</li><li><strong>服务层基类</strong>:<code>BaseService</code> 基础 CRUD + 软删除 + 分页查询</li><li><strong>全局辅助函数库</strong>:<code>Helpers/helpers.php</code>(密码加密 / 文件处理 / 驼峰下划线转换 / 随机字符串)</li><li><strong><code>Result</code> 统一响应类</strong>:<code>success</code> / <code>page</code> / <code>fail</code> / 语义化方法,统一 <code>{code, ok, msg, data}</code> 结构</li><li><strong><code>Handler</code> 全局异常处理</strong>:异常统一捕获与 JSON 响应渲染</li><li><strong>多数据库配置支持</strong>:MySQL / PostgreSQL / SQL Server / SQLite(<code>DB_CONNECTION</code> 切换)</li><li><strong><code>.env</code> 环境变量配置</strong>:敏感配置与环境解耦</li></ul><h3 id="架构特性" tabindex="-1">架构特性 <a class="header-anchor" href="#架构特性" aria-label="Permalink to "架构特性""></a></h3><ul><li>前后端完全分离架构</li><li>RESTful API 设计规范</li><li>统一响应格式(<code>code</code> / <code>ok</code> / <code>msg</code> / <code>data</code>)</li><li>软删除全局查询范围自动过滤</li><li>审计字段模型事件自动写入</li></ul>',136)])])}const f=t(i,[["render",r]]);export{u as __pageData,f as default};
|