mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
chore: 统一 URL 存放位置
This commit is contained in:
@@ -22,6 +22,8 @@ namespace MaaWpfGui.Constants
|
||||
|
||||
public const string Bilibili = "https://space.bilibili.com/3493274731940507";
|
||||
|
||||
public const string BilibiliVideo = "https://www.bilibili.com/video/";
|
||||
|
||||
public const string GitHub = "https://github.com/MaaAssistantArknights/MaaAssistantArknights";
|
||||
|
||||
public const string GitHubIssues = "https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues";
|
||||
@@ -30,10 +32,18 @@ namespace MaaWpfGui.Constants
|
||||
|
||||
public const string PrtsPlus = "https://prts.plus";
|
||||
|
||||
public const string PrtsPlusCopilotGet = "https://www.maa.plus/copilot/get/";
|
||||
|
||||
public const string PrtsPlusCopilotRating = "https://prts.maa.plus/copilot/rating";
|
||||
|
||||
public const string MapPrts = "https://map.ark-nights.com/areas?coord_override=maa";
|
||||
|
||||
public const string CustomInfrastGenerator = "https://yituliu.site/tools/maa";
|
||||
|
||||
public const string MaaApi = "https://ota.maa.plus/MaaAssistantArknights/api/";
|
||||
|
||||
public const string MaaResourceApi = "https://ota.maa.plus/MaaAssistantArknights/MaaAssistantArknights/";
|
||||
|
||||
public const string QqGroups = "https://ota.maa.plus/MaaAssistantArknights/api/qqgroup/index.html";
|
||||
|
||||
public const string QqChannel = "https://pd.qq.com/s/4j1ju9z47";
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using MaaWpfGui.Constants;
|
||||
using MaaWpfGui.Helper;
|
||||
using Stylet;
|
||||
|
||||
@@ -11,7 +12,6 @@ namespace MaaWpfGui.Models
|
||||
{
|
||||
public static class ResourceUpdater
|
||||
{
|
||||
private const string MaaResourceApi = "https://ota.maa.plus/MaaAssistantArknights/MaaAssistantArknights/";
|
||||
|
||||
private static readonly List<string> _maaSingleFiles = new List<string>
|
||||
{
|
||||
@@ -86,7 +86,7 @@ namespace MaaWpfGui.Models
|
||||
|
||||
foreach (var file in _maaSingleFiles)
|
||||
{
|
||||
var sRet = await UpdateFileWithETag(MaaResourceApi, file, file);
|
||||
var sRet = await UpdateFileWithETag(MaaUrls.MaaResourceApi, file, file);
|
||||
|
||||
if (sRet == UpdateResult.Failed)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ namespace MaaWpfGui.Models
|
||||
// 这些文件数量不固定,需要先获取索引文件,再根据索引文件下载
|
||||
private static async Task<UpdateResult> UpdateFilesWithIndex()
|
||||
{
|
||||
var indexSRet = await UpdateFileWithETag(MaaResourceApi, MaaDynamicFilesIndex, MaaDynamicFilesIndex);
|
||||
var indexSRet = await UpdateFileWithETag(MaaUrls.MaaResourceApi, MaaDynamicFilesIndex, MaaDynamicFilesIndex);
|
||||
if (indexSRet == UpdateResult.Failed || indexSRet == UpdateResult.NotModified)
|
||||
{
|
||||
return indexSRet;
|
||||
@@ -134,7 +134,7 @@ namespace MaaWpfGui.Models
|
||||
return;
|
||||
}
|
||||
|
||||
var sRet = await UpdateFileWithETag(MaaResourceApi, file, file);
|
||||
var sRet = await UpdateFileWithETag(MaaUrls.MaaResourceApi, file, file);
|
||||
if (sRet == UpdateResult.Failed)
|
||||
{
|
||||
ret = UpdateResult.Failed;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using MaaWpfGui.Constants;
|
||||
using MaaWpfGui.Helper;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -23,7 +24,6 @@ namespace MaaWpfGui.Services.Web
|
||||
public class MaaApiService : IMaaApiService
|
||||
{
|
||||
private const string CacheDir = "cache/";
|
||||
private const string MaaApi = "https://ota.maa.plus/MaaAssistantArknights/api/";
|
||||
|
||||
public MaaApiService()
|
||||
{
|
||||
@@ -31,7 +31,7 @@ namespace MaaWpfGui.Services.Web
|
||||
|
||||
public async Task<JObject> RequestMaaApiWithCache(string api)
|
||||
{
|
||||
var url = MaaApi + api;
|
||||
var url = MaaUrls.MaaApi + api;
|
||||
|
||||
var response = await Instances.HttpService.GetStringAsync(new Uri(url));
|
||||
if (response == null)
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
{
|
||||
try
|
||||
{
|
||||
var jsonResponse = await Instances.HttpService.GetStringAsync(new Uri($"https://prts.maa.plus/copilot/get/{copilotId}"));
|
||||
var jsonResponse = await Instances.HttpService.GetStringAsync(new Uri(MaaUrls.PrtsPlusCopilotGet + copilotId));
|
||||
var json = (JObject)JsonConvert.DeserializeObject(jsonResponse);
|
||||
if (json != null && json.ContainsKey("status_code") && json["status_code"]?.ToString() == "200")
|
||||
{
|
||||
@@ -302,7 +302,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
var linkParser = new Regex(@"AV\d+|(BV.*?).{10}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
foreach (Match match in linkParser.Matches(details))
|
||||
{
|
||||
Url = "https://www.bilibili.com/video/" + match.Value;
|
||||
Url = MaaUrls.BilibiliVideo + match.Value;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -832,7 +832,6 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
|
||||
private bool _isVideoTask;
|
||||
|
||||
private const string CopilotRatingUrl = "https://prts.maa.plus/copilot/rating";
|
||||
private readonly List<int> _recentlyRatedCopilotId = new List<int>(); // TODO: 可能考虑加个持久化
|
||||
|
||||
private bool _couldLikeWebJson;
|
||||
@@ -903,7 +902,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
rating,
|
||||
});
|
||||
*/
|
||||
var response = await Instances.HttpService.PostAsJsonAsync(new Uri(CopilotRatingUrl), new { id = CopilotId, rating });
|
||||
var response = await Instances.HttpService.PostAsJsonAsync(new Uri(MaaUrls.PrtsPlusCopilotRating), new { id = CopilotId, rating });
|
||||
if (response == null)
|
||||
{
|
||||
AddLog(LocalizationHelper.GetString("FailedToLikeWebJson"), UiLogColor.Error);
|
||||
|
||||
Reference in New Issue
Block a user