|
@@ -1285,22 +1285,26 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/avatar/config",
|
|
|
- Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/avatar/sts",
|
|
|
- Handler: avatar.GetAcsResponseHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/api/avatar/signature",
|
|
|
- Handler: avatar.GetSignatureResponseHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/avatar/config",
|
|
|
+ Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/avatar/sts",
|
|
|
+ Handler: avatar.GetAcsResponseHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/avatar/signature",
|
|
|
+ Handler: avatar.GetSignatureResponseHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
}
|