refactor(attachment): 头像与背景图上限并入前端图片上传限制
- 移除独立的「用户头像与资料卡图片」分组与 avatar_max_size 字段,
与参考主题保持一致:头像/资料卡背景图与投稿评论图片共用
upload_img_size 同一套用户类型 × 大小配置
- 5 处消费方(REST 头像/背景上传、后台头像字段、用户中心头像与
封面配置)全部改读 UploadLimits::limit_bytes('image'),提示语
改用 size_format 与实际上限对齐
- 附件配置仅剩上传大小/上传格式/上传行为三组;管理端 SPA 已重建,
421 项契约测试通过
This commit is contained in:
@@ -218,9 +218,8 @@ export const permissionsSchemas = {
|
||||
key: 'permissions.attachment',
|
||||
title: '附件配置',
|
||||
icon: 'fa fas fa-paperclip',
|
||||
description: '统一管理头像、上传大小、上传格式与上传行为;准入权限请在“基本权限”中配置。',
|
||||
description: '统一管理上传大小、上传格式与上传行为;准入权限请在“基本权限”中配置。',
|
||||
defaults: {
|
||||
avatar_max_size: 2,
|
||||
upload_img_size: [
|
||||
{ type: 'default', val: 5 },
|
||||
{ type: 'admin', val: 20 },
|
||||
@@ -243,14 +242,6 @@ export const permissionsSchemas = {
|
||||
close_attachment_page: true,
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'profile',
|
||||
title: '用户头像与资料卡图片',
|
||||
icon: 'fa fas fa-id-card',
|
||||
fields: [
|
||||
{ key: 'avatar_max_size', label: '头像/用户资料卡背景图大小上限 (MB)', type: 'number', min: 1, max: 10 },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'size-limits',
|
||||
title: '上传大小限制',
|
||||
@@ -263,7 +254,7 @@ export const permissionsSchemas = {
|
||||
type: 'repeater',
|
||||
min: 1,
|
||||
addText: '添加细分用户权限',
|
||||
help: '投稿、评论等前端场景允许上传的最大图片大小(单位 MB)。同一个用户满足多个条件则取最大值,「最小默认值」为所有人兜底。',
|
||||
help: '投稿、评论、头像与资料卡背景图等前端场景允许上传的最大图片大小(单位 MB)。同一个用户满足多个条件则取最大值,「最小默认值」为所有人兜底。',
|
||||
fields: uploadSizeFields.map((field) => ({ ...field, default: field.key === 'val' ? 5 : field.default })),
|
||||
},
|
||||
{ key: 'image_upload_multiple', label: '图片批量上传最大数量', type: 'number', min: 0, max: 100, unit: '张', help: '前端投稿、评论上传图片允许的单次批量上传数量(为 0 则不限制,为 1 则不能批量上传)。' },
|
||||
|
||||
Reference in New Issue
Block a user