using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; //查询公告详情 public class annDetail32 : MonoBehaviour { public async Task annDetail(int noticeId) { // 准备请求的头部信息,包含授权令牌 Dictionary head32 = new Dictionary { { "Authorization", Global.global.serverResponse.data.token } }; // 异步发送请求 string response32 = await web.SendRequest(web.URL + "/snail/notice/info?noticeId=" + noticeId, "GET", "{}", head32); // 调试输出接收到的响应 Debug.Log("3.2查询公告详情:=============== " + response32); // 解析响应的 JSON 数据 annDetail annDetailResponse = JsonConvert.DeserializeObject(response32); // 返回解析后的数据 return annDetailResponse; } }