This commit is contained in:
eson 2023-07-24 10:27:06 +08:00
parent f4def7f8a0
commit 72a6412eed
2 changed files with 7 additions and 7 deletions

View File

@ -60,10 +60,6 @@ func (l *UserGoogleLoginLogic) AfterLogic(w http.ResponseWriter, r *http.Request
</html>
`, l.redirectUrl)
fmt.Fprintln(w, html)
// if l.redirectUrl != "" {
// http.Redirect(w, r, "http://localhost:9900/api/assistant/redirect?url="+url.QueryEscape(l.redirectUrl), http.StatusFound)
// }
}
func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, userinfo *auth.UserInfo) (resp *basic.Response) {
@ -108,8 +104,8 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
log.Println(r.Json())
googleId := r.Json().Get("id").Int()
l.redirectUrl = "http://localhost:9900/oauth?token=21321123"
return resp.Set(304, "21321321")
// l.redirectUrl = "http://localhost:9900/oauth?token=21321123"
// return resp.Set(304, "21321321")
user, err := l.svcCtx.AllModels.FsUser.FindUserByGoogleId(context.TODO(), googleId)
log.Println(user)
if err != nil {

View File

@ -1,6 +1,10 @@
package config
import "github.com/zeromicro/go-zero/rest"
import (
"fusenapi/server/render/internal/types"
"github.com/zeromicro/go-zero/rest"
)
type Config struct {
rest.RestConf