Browse Source

1

herolist
dengbiao 1 week ago
parent
commit
e32ca72594
2 changed files with 8 additions and 4 deletions
  1. +5
    -1
      app/hdl/hdl_user.go
  2. +3
    -3
      app/utils/convert.go

+ 5
- 1
app/hdl/hdl_user.go View File

@@ -421,6 +421,10 @@ func ParentInfo(c *gin.Context) {
e.OutErr(c, e.ERR, err1.Error())
return
}
var imUid = "0"
if imUser != nil {
imUid = strconv.FormatInt(imUser.UserId, 10)
}
res := md.ParentInfo{
Nickname: user.Nickname,
LevelName: level.LevelName,
@@ -429,7 +433,7 @@ func ParentInfo(c *gin.Context) {
Id: utils.Int64ToStr(user.Id),
Phone: user.Phone,
WechatAccount: user.WechatAccount,
ImUid: strconv.FormatInt(imUser.UserId, 10),
ImUid: imUid,
}
e.OutSuc(c, res, nil)
return


+ 3
- 3
app/utils/convert.go View File

@@ -148,9 +148,9 @@ func interfaceSliceToJSONStyleString(slice []interface{}) string {

for _, v := range slice {
switch value := v.(type) {
case string:
// 对字符串进行转义并加上双引号
elements = append(elements, fmt.Sprintf("%q", value))
//case string:
// // 对字符串进行转义并加上双引号
// elements = append(elements, fmt.Sprintf("%q", value))
case bool:
// 直接转换为字符串
elements = append(elements, fmt.Sprintf("%v", value))


Loading…
Cancel
Save