feat(users): govern profiles and access

Normalize fixed profile fields, profile actions, and the five-column capability matrix for comments, uploads, and downloads.
This commit is contained in:
2026-08-13 00:24:54 +08:00
parent 0b06b2c7df
commit 8241570ca2
67 changed files with 780 additions and 1127 deletions
@@ -209,35 +209,6 @@ export const permissionsSchemas = {
],
},
/**
* Comment permissions
*/
comment: {
key: 'permissions.comment',
title: '评论权限',
icon: 'fas fa-comment-dots',
description: '控制评论功能的开关和权限要求。',
defaults: {
comment_allow: true,
comment_require_login: false,
comment_nested_depth: 3,
comment_allow_reply: true,
},
groups: [
{
key: 'basic',
title: '评论基础',
icon: 'fas fa-cog',
fields: [
{ key: 'comment_allow', label: '允许评论', type: 'switch', help: '全局开启评论功能' },
{ key: 'comment_require_login', label: '需登录评论', type: 'switch', help: '只有登录用户才能评论' },
{ key: 'comment_nested_depth', label: '嵌套层级', type: 'slider', min: 1, max: 5, default: 3 },
{ key: 'comment_allow_reply', label: '允许回复', type: 'switch' },
],
},
],
},
/**
* Attachment permissions
*/
@@ -247,27 +218,18 @@ export const permissionsSchemas = {
icon: 'fas fa-paperclip',
description: '控制文件上传和附件下载权限。',
defaults: {
allow_avatar_upload: true,
allow_cover_upload: true,
allow_background_upload: false,
avatar_max_size: 2,
allow_submit_images: true,
submit_image_max_size: 5,
allow_comment_images: false,
comment_image_max_size: 2,
allow_resource_upload: true,
resource_max_size: 50,
},
groups: [
{
key: 'profile',
title: '头像与封面',
title: '用户资料卡背景图',
icon: 'fas fa-user-circle',
fields: [
{ key: 'allow_avatar_upload', label: '允许用户上传头像', type: 'switch' },
{ key: 'allow_cover_upload', label: '允许用户上传封面图', type: 'switch' },
{ key: 'allow_background_upload', label: '允许用户上传背景图', type: 'switch' },
{ key: 'avatar_max_size', label: '头像/封面大小上限 (MB)', type: 'number', min: 1, max: 10 },
{ key: 'avatar_max_size', label: '头像/用户资料卡背景图大小上限 (MB)', type: 'number', min: 1, max: 10 },
],
},
{
@@ -275,9 +237,7 @@ export const permissionsSchemas = {
title: '内容上传',
icon: 'fas fa-images',
fields: [
{ key: 'allow_submit_images', label: '允许投稿插入图片', type: 'switch' },
{ key: 'submit_image_max_size', label: '投稿图片大小上限 (MB)', type: 'number', min: 1, max: 20 },
{ key: 'allow_comment_images', label: '允许评论插入图片', type: 'switch' },
{ key: 'comment_image_max_size', label: '评论图片大小上限 (MB)', type: 'number', min: 1, max: 10 },
],
},
@@ -286,23 +246,10 @@ export const permissionsSchemas = {
title: '资源附件',
icon: 'fas fa-file-archive',
fields: [
{ key: 'allow_resource_upload', label: '允许资源附件上传', type: 'switch' },
{ key: 'resource_max_size', label: '资源附件大小上限 (MB)', type: 'number', min: 1, max: 200 },
],
},
],
},
/**
* Download permissions — live UI is DownloadPermissions.vue via cms_features.
* Keep empty schema so SchemaPage cannot mis-write aksrt_settings.
*/
download: {
key: 'permissions.download',
title: '下载权限',
icon: 'fas fa-download',
description: '下载门槛由 DownloadPermissions 页维护(cms_features);人机验证服务商在「人机验证」页。',
defaults: {},
groups: [],
},
};