Skip to content

Commit

Permalink
Merge pull request #85 from SugarMGP/main
Browse files Browse the repository at this point in the history
fix: 修复逻辑错误
  • Loading branch information
XiMo-210 authored Nov 6, 2024
2 parents c6d74cf + de796c1 commit 07267c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/services/userCenterServices/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func Login(stu_id string, pass string) error {
return apiException.NoThatPasswordOrWrong
} else if resp.Code == 200 {
return nil
}else{
} else {
return apiException.ServerError
}
}
}
3 changes: 1 addition & 2 deletions app/services/userServices/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ func CreateStudentUser(username, password, studentID, IDCardNumber, email string
}

func CreateStudentUserWechat(username, password, studentID, IDCardNumber, email, wechatOpenID string) (*models.User, error) {
if !CheckWechatOpenID(wechatOpenID) {
if CheckWechatOpenID(wechatOpenID) {
return nil, apiException.OpenIDError
}
user, err := CreateStudentUser(username, password, studentID, IDCardNumber, email)
if err != nil && err != apiException.ReactiveError {
return nil, err
}
user.WechatOpenID = wechatOpenID
database.DB.Updates(user)
database.DB.Save(user)
return user, nil
}
Expand Down

0 comments on commit 07267c0

Please sign in to comment.