🎨 oauth2 update

This commit is contained in:
landaiqing
2024-08-21 22:00:47 +08:00
parent 58ca15768b
commit 78346f6a12
6 changed files with 142 additions and 23 deletions

View File

@@ -171,7 +171,7 @@ func (OAuthAPI) GiteeCallback(c *gin.Context) {
Id := strconv.Itoa(giteeUser.ID)
userSocial, err := userSocialService.QueryUserSocialByUUID(Id, enum.OAuthSourceGitee)
if errors.Is(err, gorm.ErrRecordNotFound) {
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
// 第一次登录,创建用户
uid := idgen.NextId()
uidStr := strconv.FormatInt(uid, 10)