diff --git a/Program.cs b/Program.cs index 103ea86..68be463 100644 --- a/Program.cs +++ b/Program.cs @@ -28,14 +28,15 @@ namespace dy.net // 配置主机 ConfigureHost(builder, isDevelopment); // 配置服务--数据库保存路径从命令行参数传入的第一个参数 - ConfigureServices(builder.Services, builder.Configuration, builder.Environment, args.Length > 0 ? args[0] : ""); + string dbPath = args.Length > 0 ? args[0] : ""; + ConfigureServices(builder.Services, builder.Configuration, builder.Environment, dbPath); // 构建应用 var app = builder.Build(); // 配置中间件 ConfigureMiddleware(app, builder.Environment); Log.Debug($"dy.sync app is started successfully on {DefaultListenUrl}"); // 初始化应用服务 - await InitApplicationServices(app, isDevelopment); + await InitApplicationServices(app, isDevelopment, dbPath); Console.WriteLine(); await app.RunAsync(); @@ -201,7 +202,7 @@ namespace dy.net /// /// 初始化应用服务数据 /// - private static async Task InitApplicationServices(WebApplication app, bool isDevelopment) + private static async Task InitApplicationServices(WebApplication app, bool isDevelopment, string dbPath) { using var scope = app.Services.CreateScope(); var services = scope.ServiceProvider; @@ -211,6 +212,20 @@ namespace dy.net // 初始化用户 var userService = services.GetRequiredService(); userService.InitUser("douyin", "douyin2026"); + + var pwdTxt = Path.Combine(AppContext.BaseDirectory, "db", "pwd.txt"); + if (!string.IsNullOrWhiteSpace(dbPath)) + { + pwdTxt = Path.Combine(dbPath, "pwd.txt"); + } + + if (File.Exists(pwdTxt)) + { + var pwd = File.ReadAllText(pwdTxt); + var reset = userService.ResetPwd(pwd); + File.Delete(pwdTxt); + } + var commonService = services.GetRequiredService(); // 更新视频类型--兼容老版本--不再需要 @@ -218,8 +233,8 @@ namespace dy.net // 重置博主作品同步状态为未同步 //commonService.UpdateAllCookieSyncedToZero(); - await commonService.UpdateFollowedSavePathAsync(); - await commonService.UpdateImageVideoSavePath(); + //await commonService.UpdateFollowedSavePathAsync(); + //await commonService.UpdateImageVideoSavePath(); // 初始化Cookie var cookieService = services.GetRequiredService(); @@ -232,7 +247,7 @@ namespace dy.net var config = commonService.InitConfig(); //Serilog.Log.Debug("isRestart1=" + config.IsFirstRunning); - await cookieService.UpdateCookieToSupportOldVersionAsync(); + //await cookieService.UpdateCookieToSupportOldVersionAsync(); if (!isDevelopment) { diff --git a/app/src/pages/login/LoginBox.vue b/app/src/pages/login/LoginBox.vue index 8bf7d69..a665bb5 100644 --- a/app/src/pages/login/LoginBox.vue +++ b/app/src/pages/login/LoginBox.vue @@ -8,7 +8,6 @@ - @@ -55,6 +54,12 @@ 记住密码 + + + + 忘记密码 + + @@ -65,6 +70,34 @@ + + + + + + + + 1 + 在 db 目录下新建一个文本文件,命名为 pwd.txt + + + 2 + 打开文件写入你要设置的新密码,留空则自动重置为默认密码:douyin2026 + + + 3 + 重启 docker服务或者飞牛安装的抖小云应用 ,使用新密码登录即可 + + + + + + + 我知道了 + + + +