diff --git a/service/third_login.go b/service/third_login.go index 3f29d50..9e2c3e9 100644 --- a/service/third_login.go +++ b/service/third_login.go @@ -4,6 +4,7 @@ import ( "ai-gateway/common/constant" "ai-gateway/common/dto" "ai-gateway/common/email" + "ai-gateway/common/logs" "ai-gateway/common/utils" "ai-gateway/infrastructure/redis" "ai-gateway/infrastructure/repository" @@ -49,7 +50,7 @@ func (l login) Register(ctx context.Context, req dto.ThirdRegisterReq) error { } func (l login) Login(ctx context.Context, req dto.ThirdLoginReq) (string, error) { - + start := time.Now().UnixMilli() //1. 验证账号密码 h := sha256.Sum256([]byte(req.Password)) passHash := hex.EncodeToString(h[:]) @@ -81,6 +82,8 @@ func (l login) Login(ctx context.Context, req dto.ThirdLoginReq) (string, error) gUserToken.ExpireTime = thirdUserToken.ExpireTime repository.GUserToken.UpdateUserLoginToken(ctx, gUserToken) + diff := time.Now().UnixMilli() - start + logs.NewLog("").Infof("Login cost: %d", diff) return l.GenAccessToken(gUserToken), nil }