diff --git a/model/gmodel/fs_guest_logic.go b/model/gmodel/fs_guest_logic.go index 7216deb5..1b88e95d 100755 --- a/model/gmodel/fs_guest_logic.go +++ b/model/gmodel/fs_guest_logic.go @@ -32,7 +32,16 @@ func (m *FsGuestModel) GenerateGuestID(ctx context.Context, AccessSecret uint64) logx.Error(err) return err } - return nil + + uinfo := &FsUserInfo{ + Module: FsString("module"), + UserId: FsInt64(0), + GuestId: &record.GuestId, + Metadata: FsBytes("{}"), + Ctime: &now, + Utime: &now, + } + return tx.Model(FsUserInfo{}).Create(uinfo).Error }) if err != nil { diff --git a/model/gmodel/var.go b/model/gmodel/var.go index 71fd02ff..9f707822 100644 --- a/model/gmodel/var.go +++ b/model/gmodel/var.go @@ -36,6 +36,11 @@ func FsBool(v bool) *bool { return &v } +func FsBytes(v string) *[]byte { + bs := []byte(v) + return &bs +} + // SubscriptionStatus 订阅状态 type SubscriptionStatus struct { NotificationEmail struct { diff --git a/server/auth/internal/logic/useremailconfirmationlogic.go b/server/auth/internal/logic/useremailconfirmationlogic.go index 94330ab3..38de3d7c 100644 --- a/server/auth/internal/logic/useremailconfirmationlogic.go +++ b/server/auth/internal/logic/useremailconfirmationlogic.go @@ -48,7 +48,6 @@ func FinishRegister(svcCtx *svc.ServiceContext, user *gmodel.FsUser, token *auth ) if err != nil { - return err } diff --git a/server_api/auth.api b/server_api/auth.api index 514d1b61..b3a34545 100644 --- a/server_api/auth.api +++ b/server_api/auth.api @@ -10,21 +10,27 @@ info ( import "basic.api" service auth { + // 登录接口 @handler UserLoginHandler post /api/auth/login(RequestUserLogin) returns (response); + // 注册 @handler UserRegisterHandler post /api/auth/register(RequestUserRegister) returns (response); + // 获取cookie, 成为游客 @handler AcceptCookieHandler post /api/auth/accept-cookie(request) returns (response); + // 谷歌第三方登录 @handler UserGoogleLoginHandler get /api/auth/oauth2/login/google(RequestGoogleLogin) returns (response); + // 邮箱校验 @handler UserEmailConfirmationHandler get /api/auth/email/confirmation(RequestEmailConfirmation) returns (response); + // 第三方登录,确认使用邮箱 @handler UserEmailRegisterHandler post /api/auth/oauth2/register(RequestEmailRegister) returns (response); @@ -40,6 +46,7 @@ service auth { @handler UserResetPasswordHtmlHandler get /api/auth/reset/password/html(RequestUserResetHtml) returns (response); + // 用于debug 删除帐号 @handler DebugAuthDeleteHandler post /api/auth/debug/delete(RequestAuthDelete) returns (response); }