🐛 fix bug
This commit is contained in:
@@ -4,12 +4,12 @@ import (
|
||||
"git.echol.cn/loser/logger/log"
|
||||
"github.com/gin-gonic/gin"
|
||||
"miniapp/api"
|
||||
"miniapp/global"
|
||||
"miniapp/model/app"
|
||||
"miniapp/model/app/request"
|
||||
"miniapp/model/app/response"
|
||||
r "miniapp/model/common/response"
|
||||
"miniapp/utils"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -116,15 +116,20 @@ func (u *UserApi) UpdateUserHospital(ctx *gin.Context) {
|
||||
|
||||
// GetInfo 获取用户信息
|
||||
func (u *UserApi) GetInfo(ctx *gin.Context) {
|
||||
id := ctx.Param("id")
|
||||
if id == "" {
|
||||
global.GVA_LOG.Error("参数错误")
|
||||
r.FailWithMessage("参数错误", ctx)
|
||||
//id := ctx.Param("id")
|
||||
//if id == "" {
|
||||
// global.GVA_LOG.Error("参数错误")
|
||||
// r.FailWithMessage("参数错误", ctx)
|
||||
// return
|
||||
//}
|
||||
|
||||
var ue app.User
|
||||
if api.GetUser(ctx, &ue, false, true); ctx.IsAborted() {
|
||||
return
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
userInfo, err := userService.GetUserInfo(id)
|
||||
userInfo, err := userService.GetUserInfo(strconv.Itoa(int(ue.ID)))
|
||||
if err != nil {
|
||||
log.Errorf("获取用户信息失败:%s", err.Error())
|
||||
r.FailWithMessage("获取用户信息失败"+err.Error(), ctx)
|
||||
|
||||
Reference in New Issue
Block a user