|
@@ -13,6 +13,7 @@ import (
|
|
|
Wxhook "wechat-api/internal/handler/Wxhook"
|
|
|
agent "wechat-api/internal/handler/agent"
|
|
|
agent_base "wechat-api/internal/handler/agent_base"
|
|
|
+ avatar "wechat-api/internal/handler/avatar"
|
|
|
base "wechat-api/internal/handler/base"
|
|
|
batch_msg "wechat-api/internal/handler/batch_msg"
|
|
|
category "wechat-api/internal/handler/category"
|
|
@@ -625,7 +626,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
server.AddRoutes(
|
|
|
[]rest.Route{
|
|
|
{
|
|
|
- Method: http.MethodGet,
|
|
|
+ Method: http.MethodPost,
|
|
|
Path: "/api/user/login",
|
|
|
Handler: User.DoApiUserLoginHandler(serverCtx),
|
|
|
},
|
|
@@ -633,17 +634,13 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- rest.WithMiddlewares(
|
|
|
- []rest.Middleware{serverCtx.Authority},
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodGet,
|
|
|
- Path: "/user/info",
|
|
|
- Handler: User.GetUserInfoHandler(serverCtx),
|
|
|
- },
|
|
|
- }...,
|
|
|
- ),
|
|
|
- rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodGet,
|
|
|
+ Path: "/user/info",
|
|
|
+ Handler: User.GetUserInfoHandler(serverCtx),
|
|
|
+ },
|
|
|
+ },
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
@@ -1285,4 +1282,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
),
|
|
|
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
+
|
|
|
+ server.AddRoutes(
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Miniprogram},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/api/avatar/config",
|
|
|
+ Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
+ )
|
|
|
}
|