脚本仓库配置文件订阅后更新 (#1896)

Co-authored-by: 辉鸭蛋 <huiyadanli@gmail.com>
This commit is contained in:
zdAnQi
2025-07-20 23:10:03 +08:00
committed by GitHub
parent 559d88bb6c
commit a0649d05db
3 changed files with 69 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
@@ -55,4 +55,22 @@ public class RepoWebBridge
await MessageBox.ShowAsync(e.Message, "订阅脚本链接失败!");
}
}
}
public async Task<string> GetUserConfigJson()
{
try
{
string userConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "User", "config.json");
if (!File.Exists(userConfigPath))
{
throw new Exception("用户配置文件不存在: " + userConfigPath);
}
return await File.ReadAllTextAsync(userConfigPath);
}
catch (Exception e)
{
await MessageBox.ShowAsync(e.Message, "获取用户配置失败");
return "";
}
}
}