🎨 优化用户登录接口&优化登录日志接口

This commit is contained in:
2025-10-14 01:23:40 +08:00
parent 562413c145
commit d81e9e917e
5 changed files with 20 additions and 4 deletions

View File

@@ -54,6 +54,10 @@ func (u *AppUserService) Login(req request.CodeLoginReq) (users user.User, err e
func (u *AppUserService) WechatLogin(info *providers.User) (users user.User, err error) {
openID := info.GetOpenID()
var count int64
if openID == "" {
err = fmt.Errorf("获取用户信息失败")
return
}
// 1. 判断用户是否存在
err = global.GVA_DB.Model(&users).Where("open_id = ?", openID).Count(&count).Error
if err != nil {