修改提示语

This commit is contained in:
陈国伟 2021-07-27 09:30:38 +08:00
parent 779f725bcf
commit 60ce507978
2 changed files with 8 additions and 10 deletions

View File

@ -63,12 +63,12 @@ namespace FastGithub.Dns
} }
catch (Exception ex) catch (Exception ex)
{ {
this.logger.LogWarning($"设置为本机主DNS失败:{ex.Message}"); this.logger.LogWarning($"设置为本机主DNS为{IPAddress.Loopback}失败:{ex.Message}");
} }
} }
else else
{ {
this.logger.LogWarning("平台不支持自动设置DNS请手动设置网卡的主DNS为127.0.0.1"); this.logger.LogWarning($"不支持自动设置DNS请根据你的系统平台情况修改主DNS为{IPAddress.Loopback}");
} }
await this.hostsValidator.ValidateAsync(); await this.hostsValidator.ValidateAsync();

View File

@ -77,6 +77,11 @@ namespace FastGithub
/// <param name="logger"></param> /// <param name="logger"></param>
private static void InstallCaCert(string caPublicCerPath, ILogger logger) private static void InstallCaCert(string caPublicCerPath, ILogger logger)
{ {
if (OperatingSystem.IsWindows() == false)
{
logger.LogWarning($"不支持自动安装根证书{caPublicCerPath}:请根据你的系统平台情况安装和信任根证书");
}
try try
{ {
var caCert = new X509Certificate2(caPublicCerPath); var caCert = new X509Certificate2(caPublicCerPath);
@ -89,16 +94,9 @@ namespace FastGithub
} }
} }
catch (Exception) catch (Exception)
{
if (OperatingSystem.IsWindows())
{ {
logger.LogWarning($"安装根证书{caPublicCerPath}失败:请手动安装到“将所有的证书都放入下载存储”\\“受信任的根证书颁发机构”"); logger.LogWarning($"安装根证书{caPublicCerPath}失败:请手动安装到“将所有的证书都放入下载存储”\\“受信任的根证书颁发机构”");
} }
else
{
logger.LogWarning($"安装根证书{caPublicCerPath}失败:请根据你的系统平台要求安装和信任根证书");
}
}
} }
/// <summary> /// <summary>