_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/GLScripts/MotherFuck119.cs
2024-12-11 12:03:02 +08:00

45 lines
1.2 KiB
C#

using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class MotherFuck119 : MonoBehaviour
{
public async Task<Directlist> directlistResult() // 1.19
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head119 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 异步发送请求
string response119 = await web.SendRequest(web.URL + "/snail/data/queryVoluteCoinUser", "GET", "{}", head119);
// 调试输出接收到的响应
Debug.Log("1.19查询主页蜗壳榜 =====================" + response119);
// 将响应反序列化为 KnightRoomList 对象
Directlist directlist = JsonConvert.DeserializeObject<Directlist>(response119);
// 检查反序列化是否成功
if (directlist != null && directlist.data != null)
{
//Debug.Log("获取成功");
}
else
{
Debug.LogError("directlist 数据为空");
}
Debug.Log(directlist.data.UserResponseVoList.Count);
return directlist;
}
}