🐛 fix bug
This commit is contained in:
parent
27daf68736
commit
c6ac5c15da
3
main.go
3
main.go
@ -4,6 +4,7 @@ import (
|
|||||||
"Lee-WineList/config"
|
"Lee-WineList/config"
|
||||||
"Lee-WineList/core"
|
"Lee-WineList/core"
|
||||||
"Lee-WineList/initialize"
|
"Lee-WineList/initialize"
|
||||||
|
"Lee-WineList/oauth2"
|
||||||
appRoute "Lee-WineList/router"
|
appRoute "Lee-WineList/router"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.echol.cn/loser/logger/log"
|
"git.echol.cn/loser/logger/log"
|
||||||
@ -18,7 +19,7 @@ var g errgroup.Group
|
|||||||
// 系统初始化
|
// 系统初始化
|
||||||
func init() {
|
func init() {
|
||||||
initialize.InitSystem() // 初始化系统配置
|
initialize.InitSystem() // 初始化系统配置
|
||||||
//oauth2.InitOAuth2Server() // 初始化OAuth2服务
|
oauth2.InitOAuth2Server() // 初始化OAuth2服务
|
||||||
}
|
}
|
||||||
|
|
||||||
// 启动入口
|
// 启动入口
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"Lee-WineList/common/constant"
|
"Lee-WineList/common/constant"
|
||||||
"Lee-WineList/model/entity"
|
"Lee-WineList/model/entity"
|
||||||
"Lee-WineList/repository"
|
"Lee-WineList/repository"
|
||||||
"Lee-WineList/utils"
|
|
||||||
"errors"
|
"errors"
|
||||||
"git.echol.cn/loser/logger/log"
|
"git.echol.cn/loser/logger/log"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -16,24 +15,24 @@ func getUser(account string, loginType constant.LoginType, nikeName string, avat
|
|||||||
|
|
||||||
// 定义微信小程序信息
|
// 定义微信小程序信息
|
||||||
//var unionId, openId, sessionKey string
|
//var unionId, openId, sessionKey string
|
||||||
var mobile string
|
//var mobile string
|
||||||
// 定义用户信息
|
// 定义用户信息
|
||||||
var user entity.User
|
var user entity.User
|
||||||
switch loginType {
|
switch loginType {
|
||||||
case constant.LoginTypeWeChatMiniApp:
|
case constant.LoginTypeWeChatMiniApp:
|
||||||
mobile, err = utils.WeChatUtils().GetPhoneNumber(account)
|
//mobile, err = utils.WeChatUtils().GetPhoneNumber(account)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
return
|
// return
|
||||||
}
|
//}
|
||||||
if mobile == "" {
|
//if mobile == "" {
|
||||||
err = errors.New("获取手机号失败")
|
// err = errors.New("获取手机号失败")
|
||||||
return
|
// return
|
||||||
}
|
//}
|
||||||
user.Phone = mobile
|
//user.Phone = mobile
|
||||||
user.Nickname = nikeName
|
user.Nickname = nikeName
|
||||||
user.Avatar = avatarUrl
|
user.Avatar = avatarUrl
|
||||||
default:
|
default:
|
||||||
user.Phone = account
|
//user.Phone = account
|
||||||
user.Nickname = nikeName
|
user.Nickname = nikeName
|
||||||
user.Avatar = avatarUrl
|
user.Avatar = avatarUrl
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user