From 432ab60dd0917b03228a7bbb01c03dab8647c2ad Mon Sep 17 00:00:00 2001 From: jianzhichu Date: Fri, 1 May 2026 17:54:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E5=BE=88=E5=A4=9A?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=B8=BA=E4=BA=86=E5=85=BC=E5=AE=B9=E6=97=A7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E8=84=9A=E6=9C=AC=EF=BC=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=87=8F=E5=A4=A7=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E8=80=97=E6=97=B6=E5=BE=88=E4=B9=85=EF=BC=89?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 27 +++++++++++--- app/src/pages/login/LoginBox.vue | 61 +++++++++++++++++++++++++++++-- repository/AdminUserRepository.cs | 10 +++++ service/AdminUserService.cs | 6 +++ 4 files changed, 95 insertions(+), 9 deletions(-) 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 @@
-
抖小云logo
@@ -55,6 +54,12 @@ 记住密码 + + +
+ 忘记密码 +
+
@@ -65,6 +70,34 @@
+ + + +
+ +
+
+
1
+
在 db 目录下新建一个文本文件,命名为 pwd.txt
+
+
+
2
+
打开文件写入你要设置的新密码,留空则自动重置为默认密码:douyin2026
+
+
+
3
+
重启 docker服务或者飞牛安装的抖小云应用 ,使用新密码登录即可
+
+
+ + +
+ + 我知道了 + +
+
+