更新程序 修复 获取数据失败bug,增加倒叙
This commit is contained in:
1 parent
558f9bfa04
commit
ab510c8f8d
1 file changed
+17
-2
@@ -49,6 +49,8 @@ namespace Update
|
||||
//});
|
||||
}
|
||||
private List<ChangelogItem> GetChangeInfos()
|
||||
{
|
||||
try
|
||||
{
|
||||
string paidanUrl = $"https://update-wx-order.e57.cn";
|
||||
string shanghuoUrl = $"https://update.e57.cn";
|
||||
@@ -80,15 +82,27 @@ namespace Update
|
||||
|
||||
if (DateTime.TryParse(item["publishedAt"]?.ToString(), out DateTime v))
|
||||
{
|
||||
ci.PublishedAt = v.ToString("yyyy-MM-dd");
|
||||
ci.ChangeTime = v;
|
||||
}
|
||||
list.Add(ci);
|
||||
}
|
||||
list.Sort((a, b) => b.ChangeTime.CompareTo(a.ChangeTime));
|
||||
return list;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new List<ChangelogItem>
|
||||
{
|
||||
new ChangelogItem
|
||||
{
|
||||
Notes="更新日志获取错误\n"+ex.Message
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 渲染更新日志:头部展示版本区间,中间按版本分组列出更新条目
|
||||
@@ -423,7 +437,8 @@ namespace Update
|
||||
public class ChangelogItem
|
||||
{
|
||||
public string Version { get; set; }
|
||||
public string PublishedAt { get; set; }
|
||||
public string PublishedAt => ChangeTime.ToString("yyyy-MM-dd");
|
||||
public DateTime ChangeTime { get; set; }
|
||||
public string Notes { get; set; }
|
||||
|
||||
public string[] Items
|
||||
|
||||
Reference in new issue
Block a user