v1.2.0 修改jwt有效期和获取token接口

This commit is contained in:
2025-01-03 02:13:31 +08:00
parent ac656a4125
commit 984b07e2d5
11 changed files with 101 additions and 14 deletions

View File

@@ -246,6 +246,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/user/detail",
Handler: user.DetailHandler(serverCtx),
},
{
// get new token
Method: http.MethodPost,
Path: "/user/getToken",
Handler: user.GetTokenHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
rest.WithPrefix("/api/v1"),