fix
This commit is contained in:
48
server/auth/internal/logic/debugauthdeletelogic.go
Normal file
48
server/auth/internal/logic/debugauthdeletelogic.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/basic"
|
||||
|
||||
"context"
|
||||
|
||||
"fusenapi/server/auth/internal/svc"
|
||||
"fusenapi/server/auth/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DebugAuthDeleteLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewDebugAuthDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DebugAuthDeleteLogic {
|
||||
return &DebugAuthDeleteLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// 处理进入前逻辑w,r
|
||||
// func (l *DebugAuthDeleteLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||
// }
|
||||
|
||||
func (l *DebugAuthDeleteLogic) DebugAuthDelete(req *types.RequestAuthDelete, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||
// userinfo 传入值时, 一定不为null
|
||||
|
||||
err := l.svcCtx.AllModels.FsUser.DebugAuthDelete(l.ctx, req.Email)
|
||||
if err != nil {
|
||||
return resp.SetStatus(basic.CodeDbSqlErr, err.Error())
|
||||
}
|
||||
|
||||
return resp.SetStatus(basic.CodeOK)
|
||||
}
|
||||
|
||||
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||
// func (l *DebugAuthDeleteLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
// }
|
||||
@@ -105,7 +105,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
||||
}
|
||||
logx.Info(token.Platform)
|
||||
switch token.Platform {
|
||||
case "google":
|
||||
case string(auth.PLATFORM_GOOGLE):
|
||||
// 谷歌平台的注册流程
|
||||
user, err := l.svcCtx.AllModels.FsUser.RegisterByGoogleOAuth(l.ctx, token)
|
||||
if err != nil {
|
||||
@@ -119,8 +119,8 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
||||
}
|
||||
logx.Info("success", token.TraceId)
|
||||
|
||||
case "facebook":
|
||||
case "fusen":
|
||||
case string(auth.PLATFORM_FACEBOOK):
|
||||
case string(auth.PLATFORM_FUSEN):
|
||||
// log.Println("aaaa", token)
|
||||
user, err := l.svcCtx.AllModels.FsUser.RegisterByFusen(l.ctx, token)
|
||||
if err != nil && err != gorm.ErrRecordNotFound {
|
||||
|
||||
@@ -93,7 +93,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
||||
l.registerInfo = &auth.RegisterToken{
|
||||
|
||||
Password: base64.RawURLEncoding.EncodeToString(nonce),
|
||||
Platform: "google",
|
||||
Platform: string(auth.PLATFORM_GOOGLE),
|
||||
OperateType: auth.OpTypeRegister,
|
||||
TraceId: uuid.NewString(),
|
||||
CreateAt: time.Now().UTC(),
|
||||
|
||||
@@ -47,7 +47,7 @@ func (l *UserRegisterLogic) UserRegister(req *types.RequestUserRegister, userinf
|
||||
Wid: req.Wid,
|
||||
Email: req.Email,
|
||||
Password: req.Password,
|
||||
Platform: "fusen",
|
||||
Platform: string(auth.PLATFORM_FUSEN),
|
||||
TraceId: uuid.NewString(),
|
||||
CreateAt: time.Now(),
|
||||
Extend: map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user