保存为了 websocket

This commit is contained in:
eson
2023-08-10 16:25:41 +08:00
parent 440f13bee8
commit 8c07a5f5d7
10 changed files with 30 additions and 27 deletions

View File

@@ -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

View File

@@ -71,7 +71,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
return
}
log.Println(jwtToken)
log.Println(jwtToken) // 通过websocket去, 送回通道
case "facebook":

View File

@@ -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)

View File

@@ -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 {

View File

@@ -23,7 +23,7 @@ type RequestEmailConfirmation struct {
type RequestEmailRegister struct {
Email string `json:"email"`
WCId uint64 `json:"wcid"`
Wid uint64 `json:"wid"`
GuestId uint64 `json:"guest_id"`
RegisterToken string `json:"register_token"`
}