using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Threading.Tasks; public class queryPlayerInfo : MonoBehaviour { // Start is called before the first frame update void Start() { } // 查询玩家信息 public async Task QueryPlayerInfoPro() // 1.4 { // 准备请求的头部信息,包含授权令牌 Dictionary head14 = new Dictionary { { "Authorization", Global.global.serverResponse.data.token } }; // 异步查询玩家信息 string response14 = await web.SendRequest(web.URL + "/snail/user/queryUserInfo", "POST", "{}", head14); Debug.Log("1.4查询玩家信息==================" + response14); //解析服务器传入的数据 RealPlayerInfo realPlayerInfo = new RealPlayerInfo(); realPlayerInfo = JsonConvert.DeserializeObject(response14); return realPlayerInfo; } }