using System.Collections; using System.Collections.Generic; using UnityEngine; using Newtonsoft.Json; public class auth_login { public string clientId = "e5cd7e4891bf95d1d19206ce24a7b32e"; public string grantType = "password"; public string userType = "sys_user"; public string username = "adminyyl"; public string password = "admin123"; } public class login : MonoBehaviour { public string token;//登录返回的token public void Start() { loging(); //createTemplate(); } public async void loging() { auth_login auth_Login = new auth_login(); string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(auth_Login)); Debug.Log(response); // 解析服务器返回的数据 server serverData = JsonConvert.DeserializeObject(response); //token = serverData.token; //Debug.Log(setverData.msg); } public async void createTemplate() { string response = await web.SendRequest(web.URL + "/game/gameTemplate/list", "GET"); Debug.Log(response); } }