diff --git a/Core/Config.cs b/Core/Config.cs index 8467ed4be..22d12c526 100644 --- a/Core/Config.cs +++ b/Core/Config.cs @@ -1,4 +1,5 @@ -using Core.LogModule; +using Amazon.Runtime.Internal.Transform; +using Core.LogModule; using Core.RuntimeObject; using Core.Tools; using System.ComponentModel; @@ -100,7 +101,9 @@ public static void ModifyConfig(object value, [System.Runtime.CompilerServices.C //设置启动后是否执行自动升级逻辑,这个参数只用携带,没有参数 { "no-update", ExpandOption.SetNoUpdate}, //设置配置文件路径 - { "conf", ExpandOption.SetConfigFilePath} + { "conf", ExpandOption.SetConfigFilePath}, + //设置直接接同意用户协议,终端不再弹出确认 + { "accept-eula",ExpandOption.SetEula} }; public static RunConfig Core_RunConfig { get; set; } = new(); @@ -167,6 +170,14 @@ internal static void SetRecordingMode(string value) internal static void SetNoUpdate(string value) { ProgramUpdates.Effective = false; + } + /// + /// 设置启动后是否执行自动升级逻辑 + /// + /// + internal static void SetEula(string value) + { + Core.Config.Core_RunConfig._UseAgree = true; } /// /// 设置配置文件路径 diff --git a/Server/Program.cs b/Server/Program.cs index aadb28ef8..af8b54e00 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -218,20 +218,23 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) } if (!Account.AccountInformation.State) { - if(Init.Mode!= Config.Mode.Desktop && Init.Mode!= Config.Mode.Client && Init.Mode!= Config.Mode.Docker) + if (Init.Mode != Config.Mode.Desktop && Init.Mode != Config.Mode.Client && Init.Mode != Config.Mode.Docker) { - Log.Info(nameof(DDTVService), "\r\n当前状态:未登录\r\n" + - "使用前须知:\r\n" + - "1、在使用本软件的过程中的产生的任何资料、数据等所有数据都归属原所有者。\r\n" + - "2、本软件所使用的所有资源,以及服务,均搜集自互联网,版权属于相应的个体,我们只是基于互联网使用了公开的资源进行开发。\r\n" + - "3、本软件所登陆的阿B账号仅保存在您本地,且只会用于和阿B的服务接口交互。\r\n" + - "\r\n如果您了解且同意以上内容,请按Y进入登陆流程,按其他任意键退出\r\n"); - - _UseAgree(); - - while (!Core.Config.Core_RunConfig._UseAgree) + if (!Core.Config.Core_RunConfig._UseAgree) { - Thread.Sleep(500); + Log.Info(nameof(DDTVService), "\r\n当前状态:未登录\r\n" + + "使用前须知:\r\n" + + "1、在使用本软件的过程中的产生的任何资料、数据等所有数据都归属原所有者。\r\n" + + "2、本软件所使用的所有资源,以及服务,均搜集自互联网,版权属于相应的个体,我们只是基于互联网使用了公开的资源进行开发。\r\n" + + "3、本软件所登陆的阿B账号仅保存在您本地,且只会用于和阿B的服务接口交互。\r\n" + + "\r\n如果您了解且同意以上内容,请按Y进入登陆流程,按其他任意键退出\r\n"); + + _UseAgree(); + + while (!Core.Config.Core_RunConfig._UseAgree) + { + Thread.Sleep(500); + } } await Login.QR();//如果没有登录态,需要执行扫码 while (!Account.AccountInformation.State)