保存为了 websocket
This commit is contained in:
@@ -117,11 +117,11 @@ func init() {
|
||||
EmailTasks: make(chan *EmailFormat, 10),
|
||||
Auth: smtp.PlainAuth(
|
||||
"",
|
||||
"user@example.com",
|
||||
"password",
|
||||
"support@fusenpack.com",
|
||||
"Fusenpack2021",
|
||||
"smtp.gmail.com",
|
||||
),
|
||||
FromEmail: "user@example.com",
|
||||
FromEmail: "support@fusenpack.com",
|
||||
emailSending: make(map[string]*EmailTask, 10),
|
||||
ResendTimeLimit: time.Minute * 1,
|
||||
semaphore: make(chan struct{}, 10), // Initialize semaphore with a capacity of 10
|
||||
|
||||
@@ -71,7 +71,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
||||
return
|
||||
}
|
||||
|
||||
log.Println(jwtToken)
|
||||
log.Println(jwtToken) // 通过websocket去, 送回通道
|
||||
|
||||
case "facebook":
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ func (l *UserEmailRegisterLogic) UserEmailRegister(req *types.RequestEmailRegist
|
||||
|
||||
// 确认email 重新序列化
|
||||
token.Email = req.Email
|
||||
token.WCId = req.WCId
|
||||
token.WId = req.Wid
|
||||
token.GuestId = req.GuestId
|
||||
|
||||
clurl, err := l.svcCtx.TokenManger.Generate(token)
|
||||
|
||||
@@ -67,7 +67,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
||||
ctx := context.WithValue(context.Background(), oauth2.HTTPClient, customClient)
|
||||
|
||||
var googleOauthConfig = &oauth2.Config{
|
||||
RedirectURL: "http://localhost:9900/api/user/oauth2/login/google",
|
||||
RedirectURL: fmt.Sprintf("http://%s/api/user/oauth2/login/google", l.svcCtx.Config.MainAddress),
|
||||
ClientID: l.svcCtx.Config.OAuth.Google.Appid,
|
||||
ClientSecret: l.svcCtx.Config.OAuth.Google.Secret,
|
||||
Scopes: []string{"https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"},
|
||||
@@ -79,6 +79,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
||||
logx.Error(err)
|
||||
resp.SetStatus(basic.CodeApiErr)
|
||||
}
|
||||
|
||||
ses := requests.NewSession()
|
||||
ses.Config().SetProxy("socks5://127.0.0.1:1080") // 代理 为了测试功能
|
||||
|
||||
@@ -91,7 +92,6 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
||||
log.Println(r.Json())
|
||||
|
||||
googleId := r.Json().Get("id").Int()
|
||||
|
||||
user, err := l.svcCtx.AllModels.FsUser.FindUserByGoogleId(context.TODO(), googleId)
|
||||
if err != nil {
|
||||
if err != gorm.ErrRecordNotFound {
|
||||
|
||||
Reference in New Issue
Block a user