feat: 增强管理员权限与角色管理功能

- 在 SyncAdminAuthorizationCommand 中新增对代理和抽奖菜单操作的同步功能,确保缺失的菜单操作行能够被创建。
- 更新多个控制器中的权限检查逻辑,使用 hasPermissionCode 替代原有的权限验证方式,提升权限管理的灵活性。
- 引入 ApiMessage 统一错误响应格式,确保在权限不足时返回一致的错误信息。
- 更新 AdminRole 和 AdminUser 模型,增强角色与用户的权限管理功能,支持更细粒度的权限控制。
This commit is contained in:
2026-06-03 10:56:36 +08:00
parent 1dcd4716c5
commit 0527c7c392
96 changed files with 2215 additions and 139 deletions

View File

@@ -0,0 +1,60 @@
<?php
/** 按字段定制的格式/唯一性说明 */
return [
'code' => [
'regex' => '编码只能使用字母、数字、下划线_和连字符-);站点编码须以小写字母或数字开头。',
'unique' => '该编码已被占用,请更换。',
],
'slug' => [
'regex' => '标识只能使用小写字母、数字、下划线和连字符。',
'unique' => '该标识已被占用,请更换。',
],
'account' => [
'regex' => '登录账号只能使用字母、数字、点(.)、下划线和连字符。',
],
'username' => [
'regex' => '用户名只能使用字母、数字、点(.)、下划线和连字符。',
'unique' => '该用户名已被占用,请更换。',
],
'email' => [
'unique' => '该邮箱已被占用,请更换。',
],
'draw_no' => [
'regex' => '期号格式须为 YYYYMMDD-流水号(例如 20260101-001。',
],
'number_4d' => [
'regex' => '号码必须是 4 位数字。',
],
'normalized_number' => [
'regex' => '号码必须是 4 位数字。',
'size' => '号码必须是 4 位数字。',
],
'wallet_api_url' => [
'wallet_api_url' => '钱包 API 地址必须是 https 的公开域名根地址,不能为 localhost、内网 IP且不能带路径或查询参数。',
],
'amount_delta' => [
'not_in' => '调整金额不能为 0。',
],
'password' => [
'min' => '密码至少需要 :min 个字符。',
],
'reason' => [
'min' => '原因至少需要 :min 个字符。',
],
'lines' => [
'max' => '单次最多提交 :max 注。',
'min' => '至少需要提交 :min 注。',
],
'items' => [
'min' => '至少需要 :min 条配置。',
'max' => '最多只能提交 :max 条配置。',
'size' => '必须恰好包含 :size 条配置。',
],
'role_slugs' => [
'min' => '至少须选择一个角色。',
],
'role_ids' => [
'required' => '请选择角色。',
],
];