修改tpl的参数传入问题

This commit is contained in:
eson
2023-07-21 11:24:26 +08:00
parent bfa1872595
commit 44a3666d68
9 changed files with 15 additions and 11 deletions

View File

@@ -25,6 +25,8 @@ type UserGoogleLoginLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
redirectUrl string
}
func NewUserGoogleLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserGoogleLoginLogic {
@@ -39,8 +41,10 @@ func (l *UserGoogleLoginLogic) BeforeLogic(w http.ResponseWriter, r *http.Reques
log.Println(r, w)
}
func (l *UserGoogleLoginLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
http.Redirect(w, r, "http://localhost:9900/redirect?uri=%s", http.StatusFound)
func (l *UserGoogleLoginLogic) AfterLogic(w http.ResponseWriter, r *http.Request) {
if l.redirectUrl != "" {
http.Redirect(w, r, "http://localhost:9900/assistant/redirect?url="+url.QueryEscape(l.redirectUrl), http.StatusFound)
}
}
func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, userinfo *auth.UserInfo) (resp *basic.Response) {