接动态地图,忘记密码,文件弹窗置顶

This commit is contained in:
Caiyanpeng committed 2021-04-27 14:58:49 +08:00
1 parent 2b275d6dc5
commit 1002b0433a
206 files changed
+13484 -2849

No files matched your search

+6
View File
@@ -142,6 +142,12 @@ namespace Assets.Scripts.Apis
var response = await httpClient.GetAsync(url, HttpCompletionOption.ResponseContentRead).ConfigureAwait(false);
return await ParseJsonAsync<T>(response);
}
protected async Task<System.IO.Stream> GetThirdPartStreamAsync(string url)
{
AddLanguage();
var response = await httpClient.GetAsync(url, HttpCompletionOption.ResponseContentRead).ConfigureAwait(false);
return await response.Content.ReadAsStreamAsync();
}
private async Task<T> ParseJsonAsync<T>(HttpResponseMessage response)
{
var result = await response.Content.ReadAsStringAsync();
+1 -1
View File
@@ -15,7 +15,7 @@ namespace Assets.Scripts.Apis
{
return Get($"Map/GetMapToken?name={name}");
}
/// <summary>
/// 获取路线数据
/// </summary>
+142
View File
@@ -0,0 +1,142 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Apis.Models
{
public class AddressDetail
{
/// <summary>
/// 江苏省
/// </summary>
public string province { get; set; }
/// <summary>
/// 南京市
/// </summary>
public string city { get; set; }
/// <summary>
///
/// </summary>
public string district { get; set; }
/// <summary>
///
/// </summary>
public string street { get; set; }
/// <summary>
///
/// </summary>
public string street_number { get; set; }
/// <summary>
///
/// </summary>
public int city_code { get; set; }
}
public class LocationPoint
{
/// <summary>
///
/// </summary>
public string y { get; set; }
/// <summary>
///
/// </summary>
public string x { get; set; }
}
public class LocationContent
{
/// <summary>
///
/// </summary>
public AddressDetail address_detail { get; set; }
/// <summary>
/// 江苏省南京市
/// </summary>
public string address { get; set; }
/// <summary>
///
/// </summary>
public LocationPoint point { get; set; }
}
public class LocationModel
{
/// <summary>
/// CN|江苏|南京|None|CHINANET|0|0
/// </summary>
public string address { get; set; }
/// <summary>
///
/// </summary>
public LocationContent content { get; set; }
/// <summary>
///
/// </summary>
public int status { get; set; }
public string message { get; set; }
}
public class IpToGeoModel
{
/// <summary>
///
/// </summary>
public string ip { get; set; }
/// <summary>
///
/// </summary>
public string continent_code { get; set; }
/// <summary>
///
/// </summary>
public string country { get; set; }
/// <summary>
///
/// </summary>
public string country_code { get; set; }
/// <summary>
///
/// </summary>
public string country_code3 { get; set; }
/// <summary>
///
/// </summary>
public string region { get; set; }
/// <summary>
///
/// </summary>
public string region_code { get; set; }
/// <summary>
///
/// </summary>
public string city { get; set; }
/// <summary>
///
/// </summary>
public double latitude { get; set; }
/// <summary>
///
/// </summary>
public double longitude { get; set; }
/// <summary>
///
/// </summary>
public string timezone { get; set; }
/// <summary>
///
/// </summary>
public int offset { get; set; }
/// <summary>
///
/// </summary>
public int asn { get; set; }
/// <summary>
///
/// </summary>
public string organization { get; set; }
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c86940fb819b49e419c693d684897a77
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+12 -1
View File
@@ -1,6 +1,8 @@
using Newtonsoft.Json.Linq;
using Assets.Scripts.Apis.Models;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -17,5 +19,14 @@ namespace Assets.Scripts.Apis
{
return await GetThirdPartAsync<JObject>($"https://api.weixin.qq.com/sns/userinfo?access_token=" + accessToken + "&openid=" + openId);
}
public async Task<IpToGeoModel> GetLocationInfo()
{
return await GetThirdPartAsync<IpToGeoModel>("https://ip.seeip.org/geoip");
//return await GetThirdPartAsync<LocationModel>($"http://api.map.baidu.com/location/ip?ak=NsfCV0Sp5r0O8yY49RPIpOQZkWFlDnmi&coor=gcj02");
}
public async Task<Stream> GetMapImage(IpToGeoModel locationInfo)
{
return await GetThirdPartStreamAsync($"https://api.mapbox.com/styles/v1/mapbox/dark-v10/static/{locationInfo.longitude},{locationInfo.latitude},12.14,0/1280x1280?access_token=pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA");
}
}
}
+4 -1
View File
@@ -280,6 +280,9 @@ namespace Assets.Scripts.Apis
return await GetAsync<JsonResult<JObject>>("/Home/GetNotify");
}
public async Task<JsonResult<JObject>> ResetPassword(string phone, string captcha, string newPwd)
{
return await PostAsync<JsonResult<JObject>>("NoAuth/v1/ResetPassword", new {phone,captcha,newPwd });
}
}
}