用户功能设置收口与废弃后台链路清理

This commit is contained in:
2026-08-23 22:09:12 +08:00
parent 081eb0870d
commit 86692ff3f9
59 changed files with 506 additions and 1767 deletions
@@ -54,8 +54,10 @@ trait UserControllerProfileMediaOperations {
return $this->error(__('请先登录', 'aksrt'), 401);
}
$capability = $is_avatar ? 'upload_avatar' : 'upload_profile_background';
if (!function_exists('aksrt_user_can') || !aksrt_user_can($capability, $user_id)) {
$upload_enabled = $is_avatar
? function_exists('aksrt_is_avatar_upload_enabled') && aksrt_is_avatar_upload_enabled()
: function_exists('aksrt_is_user_cover_upload_enabled') && aksrt_is_user_cover_upload_enabled();
if (!$upload_enabled) {
return $this->error($is_avatar
? __('当前账号没有上传头像的权限', 'aksrt')
: __('当前账号没有上传用户资料卡背景图的权限', 'aksrt'), 403);