_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Union16/UnionPage16.cs

38 lines
1.2 KiB
C#

using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class UnionPage16 : MonoBehaviour
{
UnionPage unionPage =new UnionPage();
public async Task<UnionPage> queryUnionPage(int orderByDesc) // 5.2.6
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head16 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体
UnionPageBody unionPageBody = new UnionPageBody
{
//userId = Global.global.serverResponse.data.userId,
orderByDesc = orderByDesc
};
// 异步发送请求
string response16 = await web.SendRequest(web.URL + "/snail/union/queryPage", "POST", JsonUtility.ToJson(unionPageBody), head16);
// 调试输出接收到的响应
Debug.Log("1.6查询工会页面" + response16);
// 将响应反序列化为对象
UnionPage unionPage = JsonConvert.DeserializeObject<UnionPage>(response16);
//Debug.Log("8==================================D"+unionPage.Data.DataList[0].LeaderUserName);
return unionPage;
}
}