Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun

This commit is contained in:
wangchuxiao 2022-05-10 12:30:16 +08:00
commit 00b58068dc
2 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import (
open_im_sdk "Open_IM/pkg/proto/sdk_ws" open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"github.com/fatih/structs"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"net/http" "net/http"
"strings" "strings"
@ -119,6 +120,7 @@ func ParseToken(c *gin.Context) {
} }
resp := api.ParseTokenResp{CommResp: api.CommResp{ErrCode: 0, ErrMsg: ""}, ExpireTime: api.ExpireTime{ExpireTimeSeconds: uint32(expireTime)}} resp := api.ParseTokenResp{CommResp: api.CommResp{ErrCode: 0, ErrMsg: ""}, ExpireTime: api.ExpireTime{ExpireTimeSeconds: uint32(expireTime)}}
resp.Data = structs.Map(&resp.ExpireTime)
log.NewInfo(params.OperationID, "ParseToken return ", resp) log.NewInfo(params.OperationID, "ParseToken return ", resp)
c.JSON(http.StatusOK, resp) c.JSON(http.StatusOK, resp)
} }

View File

@ -53,5 +53,6 @@ type ExpireTime struct {
type ParseTokenResp struct { type ParseTokenResp struct {
CommResp CommResp
ExpireTime ExpireTime `json:"expireTime"` Data map[string]interface{} `json:"data"`
ExpireTime ExpireTime `json:"-"`
} }