fix: 权限列表JSON字段与角色可编辑; 前台site_id与SPA; 首页积木扩展区

Made-with: Cursor
This commit is contained in:
whm
2026-03-19 17:31:18 +08:00
parent e1fc257435
commit 0360ee5261
10 changed files with 210 additions and 54 deletions

View File

@@ -122,7 +122,8 @@ func UpdateRolePermissions(c *gin.Context) {
coll := config.GetDB(config.DBName).Collection("role_permissions")
filter := bson.M{"role_id": roleID}
set := bson.M{"role_id": roleID, "permissions": input.Permissions}
if input.RoleName != "" && roleID >= customRoleIDStart {
// 超级管理员(9527)已拦截;其余预定义(0/1)与自定义角色均可更新显示名称
if input.RoleName != "" {
set["role_name"] = input.RoleName
}
update := bson.M{"$set": set}