feat: 增强管理员权限与角色管理功能
- 在 SyncAdminAuthorizationCommand 中新增对代理和抽奖菜单操作的同步功能,确保缺失的菜单操作行能够被创建。 - 更新多个控制器中的权限检查逻辑,使用 hasPermissionCode 替代原有的权限验证方式,提升权限管理的灵活性。 - 引入 ApiMessage 统一错误响应格式,确保在权限不足时返回一致的错误信息。 - 更新 AdminRole 和 AdminUser 模型,增强角色与用户的权限管理功能,支持更细粒度的权限控制。
This commit is contained in:
113
lang/zh/validation_rules.php
Normal file
113
lang/zh/validation_rules.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
/** Laravel 标准校验规则中文文案 */
|
||||
return [
|
||||
'accepted' => '请勾选接受 :attribute。',
|
||||
'accepted_if' => '当 :other 为 :value 时,必须接受 :attribute。',
|
||||
'active_url' => ':attribute 必须是有效的网址。',
|
||||
'after' => ':attribute 必须晚于 :date。',
|
||||
'after_or_equal' => ':attribute 必须不早于 :date。',
|
||||
'alpha' => ':attribute 只能包含字母。',
|
||||
'alpha_dash' => ':attribute 只能包含字母、数字、下划线和连字符。',
|
||||
'alpha_num' => ':attribute 只能包含字母和数字。',
|
||||
'array' => ':attribute 必须是列表。',
|
||||
'ascii' => ':attribute 只能包含半角字母、数字和符号。',
|
||||
'before' => ':attribute 必须早于 :date。',
|
||||
'before_or_equal' => ':attribute 必须不晚于 :date。',
|
||||
'between' => [
|
||||
'array' => ':attribute 项数须在 :min 到 :max 之间。',
|
||||
'file' => ':attribute 大小须在 :min 到 :max KB 之间。',
|
||||
'numeric' => ':attribute 须在 :min 到 :max 之间。',
|
||||
'string' => ':attribute 长度须在 :min 到 :max 个字符之间。',
|
||||
],
|
||||
'boolean' => ':attribute 必须是是或否。',
|
||||
'confirmed' => ':attribute 两次输入不一致。',
|
||||
'date' => ':attribute 必须是有效日期。',
|
||||
'date_equals' => ':attribute 必须等于 :date。',
|
||||
'date_format' => ':attribute 格式须为 :format。',
|
||||
'decimal' => ':attribute 须保留 :decimal 位小数。',
|
||||
'declined' => '必须拒绝 :attribute。',
|
||||
'different' => ':attribute 与 :other 不能相同。',
|
||||
'digits' => ':attribute 必须是 :digits 位数字。',
|
||||
'digits_between' => ':attribute 须在 :min 到 :max 位数字之间。',
|
||||
'distinct' => ':attribute 存在重复值。',
|
||||
'email' => ':attribute 必须是有效的邮箱地址。',
|
||||
'ends_with' => ':attribute 必须以以下之一结尾::values。',
|
||||
'enum' => '所选的 :attribute 无效。',
|
||||
'exists' => '所选的 :attribute 不存在或不可用。',
|
||||
'file' => ':attribute 必须是文件。',
|
||||
'filled' => ':attribute 不能为空。',
|
||||
'gt' => [
|
||||
'array' => ':attribute 项数须多于 :value 个。',
|
||||
'file' => ':attribute 须大于 :value KB。',
|
||||
'numeric' => ':attribute 须大于 :value。',
|
||||
'string' => ':attribute 须多于 :value 个字符。',
|
||||
],
|
||||
'gte' => [
|
||||
'array' => ':attribute 至少须有 :value 项。',
|
||||
'file' => ':attribute 须不小于 :value KB。',
|
||||
'numeric' => ':attribute 须不小于 :value。',
|
||||
'string' => ':attribute 至少须 :value 个字符。',
|
||||
],
|
||||
'image' => ':attribute 必须是图片。',
|
||||
'in' => ':attribute 取值无效。',
|
||||
'in_array' => ':attribute 不存在于 :other 中。',
|
||||
'integer' => ':attribute 必须是整数。',
|
||||
'ip' => ':attribute 必须是有效的 IP 地址。',
|
||||
'json' => ':attribute 必须是有效的 JSON。',
|
||||
'lowercase' => ':attribute 必须是小写。',
|
||||
'lt' => [
|
||||
'array' => ':attribute 项数须少于 :value 个。',
|
||||
'file' => ':attribute 须小于 :value KB。',
|
||||
'numeric' => ':attribute 须小于 :value。',
|
||||
'string' => ':attribute 须少于 :value 个字符。',
|
||||
],
|
||||
'lte' => [
|
||||
'array' => ':attribute 最多 :value 项。',
|
||||
'file' => ':attribute 须不大于 :value KB。',
|
||||
'numeric' => ':attribute 须不大于 :value。',
|
||||
'string' => ':attribute 最多 :value 个字符。',
|
||||
],
|
||||
'max' => [
|
||||
'array' => ':attribute 最多 :max 项。',
|
||||
'file' => ':attribute 不能超过 :max KB。',
|
||||
'numeric' => ':attribute 不能大于 :max。',
|
||||
'string' => ':attribute 不能超过 :max 个字符。',
|
||||
],
|
||||
'min' => [
|
||||
'array' => ':attribute 至少 :min 项。',
|
||||
'file' => ':attribute 至少 :min KB。',
|
||||
'numeric' => ':attribute 不能小于 :min。',
|
||||
'string' => ':attribute 至少 :min 个字符。',
|
||||
],
|
||||
'not_in' => ':attribute 取值无效。',
|
||||
'not_regex' => ':attribute 格式不正确。',
|
||||
'numeric' => ':attribute 必须是数字。',
|
||||
'present' => ':attribute 必须提交(可为空)。',
|
||||
'prohibited' => ':attribute 不允许提交。',
|
||||
'prohibited_if' => '当 :other 为 :value 时,不允许提交 :attribute。',
|
||||
'regex' => ':attribute 格式不正确。',
|
||||
'required' => ':attribute 不能为空。',
|
||||
'required_if' => '当 :other 为 :value 时,:attribute 不能为空。',
|
||||
'required_unless' => '除非 :other 在 :values 中,否则 :attribute 不能为空。',
|
||||
'required_with' => '当存在 :values 时,:attribute 不能为空。',
|
||||
'required_with_all' => '当存在 :values 时,:attribute 不能为空。',
|
||||
'required_without' => '当不存在 :values 时,:attribute 不能为空。',
|
||||
'required_without_all' => '当 :values 均不存在时,:attribute 不能为空。',
|
||||
'required_array_keys' => ':attribute 须包含::values。',
|
||||
'same' => ':attribute 必须与 :other 一致。',
|
||||
'size' => [
|
||||
'array' => ':attribute 必须包含 :size 项。',
|
||||
'file' => ':attribute 必须为 :size KB。',
|
||||
'numeric' => ':attribute 必须为 :size。',
|
||||
'string' => ':attribute 必须为 :size 个字符。',
|
||||
],
|
||||
'starts_with' => ':attribute 必须以以下之一开头::values。',
|
||||
'string' => ':attribute 必须是文本。',
|
||||
'timezone' => ':attribute 必须是有效的时区。',
|
||||
'unique' => ':attribute 已被占用,请更换。',
|
||||
'uploaded' => ':attribute 上传失败。',
|
||||
'uppercase' => ':attribute 必须是大写。',
|
||||
'url' => ':attribute 必须是有效的网址。',
|
||||
'uuid' => ':attribute 必须是有效的 UUID。',
|
||||
];
|
||||
Reference in New Issue
Block a user