usr := util.DM.GetUser(token)
if util.DM.ExistsUser(token) == 1 {
var self map[string]interface{} = make(map[string]interface{}, 0)
obj["ret"] = "0"
obj["msg"] = ""
self["platform"] = usr.Platform
self["uid"] = usr.Uid
self["nickname"] = usr.Nick
self["avatar"] = usr.Head
self["sex"] = usr.Sex
self["gold"] = usr.AppCoin
self["token"] = usr.Token
obj["self"] = self
} else {
var self map[string]interface{} = make(map[string]interface{})
obj["ret"] = "-1"
obj["msg"] = "The token is invalid"
obj["self"] = self
}
baseData, err := json.Marshal(obj)
if err != nil {
fmt.Println("json Marshal err", err)
}
网友评论