🐛 fix bug
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"Lee-WineList/common/constant"
|
||||
"Lee-WineList/model/entity"
|
||||
"Lee-WineList/repository"
|
||||
"Lee-WineList/utils"
|
||||
"errors"
|
||||
"git.echol.cn/loser/logger/log"
|
||||
"strconv"
|
||||
@@ -16,24 +15,24 @@ func getUser(account string, loginType constant.LoginType, nikeName string, avat
|
||||
|
||||
// 定义微信小程序信息
|
||||
//var unionId, openId, sessionKey string
|
||||
var mobile string
|
||||
//var mobile string
|
||||
// 定义用户信息
|
||||
var user entity.User
|
||||
switch loginType {
|
||||
case constant.LoginTypeWeChatMiniApp:
|
||||
mobile, err = utils.WeChatUtils().GetPhoneNumber(account)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if mobile == "" {
|
||||
err = errors.New("获取手机号失败")
|
||||
return
|
||||
}
|
||||
user.Phone = mobile
|
||||
//mobile, err = utils.WeChatUtils().GetPhoneNumber(account)
|
||||
//if err != nil {
|
||||
// return
|
||||
//}
|
||||
//if mobile == "" {
|
||||
// err = errors.New("获取手机号失败")
|
||||
// return
|
||||
//}
|
||||
//user.Phone = mobile
|
||||
user.Nickname = nikeName
|
||||
user.Avatar = avatarUrl
|
||||
default:
|
||||
user.Phone = account
|
||||
//user.Phone = account
|
||||
user.Nickname = nikeName
|
||||
user.Avatar = avatarUrl
|
||||
}
|
||||
|
Reference in New Issue
Block a user