修复proxy不传递query参数的问题

This commit is contained in:
eson
2023-07-18 13:04:29 +08:00
parent 125de6dde8
commit e4e9339071
9 changed files with 77 additions and 65 deletions

View File

@@ -68,15 +68,10 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Handler: UserOderDeleteHandler(serverCtx),
},
{
Method: http.MethodPost,
Method: http.MethodGet,
Path: "/api/user/oauth2/login/google",
Handler: UserGoogleLoginHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/user/oauth2/login",
Handler: UserOAuth2LoginHandler(serverCtx),
},
},
)
}

View File

@@ -2,6 +2,7 @@ package handler
import (
"errors"
"log"
"net/http"
"github.com/zeromicro/go-zero/core/logx"
@@ -53,6 +54,7 @@ func UserGoogleLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
userinfo = &auth.UserInfo{UserId: 0, GuestId: 0}
}
log.Println(r.URL.String(), r.URL.Query())
var req types.RequestGoogleLogin
// 如果端点有请求结构体则使用httpx.Parse方法从HTTP请求体中解析请求数据
if err := httpx.Parse(r, &req); err != nil {