using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; //10.5开启卡槽 public class openSlot105 : MonoBehaviour { public async Task OpenSlot() { // 准备请求的头部信息,包含授权令牌 Dictionary head = new Dictionary { { "Authorization", Global.global.serverResponse.data.token } }; // 异步发送请求以获取最新的蜗牛骑士信息 string response0105 = await web.SendRequest(web.URL + "/snail/mining/openSlot", "POST", "{}", head); // 调试输出接收到的响应 Debug.Log("10.5开启卡槽" + response0105); // 将响应反序列化为对象 OpenSlot openSlot = JsonConvert.DeserializeObject(response0105); bool isSucceed; if (openSlot.code == 200) { isSucceed = true; } else { isSucceed = false; } // 返回解析后的对象 return isSucceed; } public async Task OpenSlotstr() { // 准备请求的头部信息,包含授权令牌 Dictionary head = new Dictionary { { "Authorization", Global.global.serverResponse.data.token } }; // 异步发送请求以获取最新的蜗牛骑士信息 string response0105 = await web.SendRequest(web.URL + "/snail/mining/openSlot", "POST", "{}", head); // 调试输出接收到的响应 Debug.Log("10.5开启卡槽" + response0105); // 将响应反序列化为对象 OpenSlot openSlot = JsonConvert.DeserializeObject(response0105); string isSucceed = openSlot.message; // 返回解析后的对象 return isSucceed; } } //===========返回================================== public class OpenSlot:Response { public string data; }