_xiaofang/xiaofang/Assets/Script/DirllInterface/getTemplateList.cs

36 lines
1.2 KiB
C#
Raw Normal View History

2024-11-29 17:27:21 +08:00
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
2024-12-11 15:32:27 +08:00
using System.Threading.Tasks;
2024-11-29 17:27:21 +08:00
using Unity.VisualScripting.Antlr3.Runtime;
using UnityEngine;
public class getTemplateList : MonoBehaviour
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD> token
public Dictionary<string, string> CreateHeaders()
{
return new Dictionary<string, string>
{
2024-12-11 15:32:27 +08:00
{ "Authorization","Bearer "+GlobalData.ServerData.data.access_token },
2024-11-29 17:27:21 +08:00
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
};
}
//<2F><>ȡģ<C8A1><C4A3><EFBFBD>б<EFBFBD>
2024-12-11 15:32:27 +08:00
public async Task<TemplateListData> TemplaRst()
2024-11-29 17:27:21 +08:00
{
string response = await web.SendRequest(web.URL + "/game/gameTemplate/list", "GET", "", CreateHeaders());
Debug.Log("<22><>ȡģ<C8A1><C4A3><EFBFBD>б<EFBFBD>" + response);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
TemplateListData templateListData = JsonConvert.DeserializeObject<TemplateListData>(response);
Debug.Log("================" + templateListData.msg);
2024-12-11 15:32:27 +08:00
return templateListData;
2024-11-29 17:27:21 +08:00
}
}
//=======================================================================================================
public class TemplateListData : Response
{
public string[] data;
}
//=================