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
+5 -1
View File
@@ -13,7 +13,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
[]rest.Route{
{Method: http.MethodGet, Path: "/api/health", Handler: healthHandler(ctx)},
{Method: http.MethodPost, Path: "/api/auth/login", Handler: loginHandler(ctx)},
{Method: http.MethodPost, Path: "/api/auth/register", Handler: registerHandler(ctx)},
},
)
@@ -23,6 +22,11 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/user/change-password", Handler: changePasswordHandler(ctx)},
{Method: http.MethodGet, Path: "/api/user/info", Handler: userInfoHandler(ctx)},
{Method: http.MethodGet, Path: "/api/user/list", Handler: listUsersHandler(ctx)},
{Method: http.MethodPost, Path: "/api/user/create", Handler: createUserHandler(ctx)},
{Method: http.MethodPost, Path: "/api/user/update", Handler: updateUserHandler(ctx)},
{Method: http.MethodPost, Path: "/api/user/delete", Handler: deleteUserHandler(ctx)},
},
)