feat: 新增账号管理功能,完善权限控制与用户信息同步

1.  新增用户管理后台接口与前端页面,支持管理员增删改查用户账号
2.  新增RBAC权限控制系统,按角色分配菜单与操作权限
3.  优化登录响应与用户信息接口,返回完整权限码与用户数据
4.  新增密码安全校验,提示纯数字密码风险
5.  移除废弃的注册接口,统一用户管理逻辑
6.  更新前端路由与侧边栏权限过滤逻辑
This commit is contained in:
SunYF
2026-09-02 14:54:54 +08:00
parent 8694162d94
commit 665ff257dc
9 changed files with 517 additions and 74 deletions
+3
View File
@@ -3,6 +3,7 @@ package handler
import (
"errors"
"net/http"
"strconv"
"strings"
"time"
@@ -104,6 +105,8 @@ func authInterceptor(ctx *svc.ServiceContext) func(next http.HandlerFunc) http.H
}
renewIfNearExpiry(ctx, w, claims)
r.Header.Set("X-Username", claims.Username)
r.Header.Set("X-Role", claims.Role)
r.Header.Set("X-UserID", strconv.Itoa(claims.UserID))
next.ServeHTTP(w, r)
})
}