mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-03-17 16:36:44 +08:00
fix: 补齐 ATX 控制器缺失接口并完成全项目 clippy -D warnings 修复
This commit is contained in:
@@ -92,11 +92,7 @@ fn is_public_endpoint(path: &str) -> bool {
|
||||
// Note: paths here are relative to /api since middleware is applied within the nested router
|
||||
matches!(
|
||||
path,
|
||||
"/"
|
||||
| "/auth/login"
|
||||
| "/health"
|
||||
| "/setup"
|
||||
| "/setup/init"
|
||||
"/" | "/auth/login" | "/health" | "/setup" | "/setup/init"
|
||||
) || path.starts_with("/assets/")
|
||||
|| path.starts_with("/static/")
|
||||
|| path.ends_with(".js")
|
||||
|
||||
@@ -161,13 +161,12 @@ impl UserStore {
|
||||
}
|
||||
|
||||
let now = Utc::now();
|
||||
let result =
|
||||
sqlx::query("UPDATE users SET username = ?1, updated_at = ?2 WHERE id = ?3")
|
||||
.bind(new_username)
|
||||
.bind(now.to_rfc3339())
|
||||
.bind(user_id)
|
||||
.execute(&self.pool)
|
||||
.await?;
|
||||
let result = sqlx::query("UPDATE users SET username = ?1, updated_at = ?2 WHERE id = ?3")
|
||||
.bind(new_username)
|
||||
.bind(now.to_rfc3339())
|
||||
.bind(user_id)
|
||||
.execute(&self.pool)
|
||||
.await?;
|
||||
|
||||
if result.rows_affected() == 0 {
|
||||
return Err(AppError::NotFound("User not found".to_string()));
|
||||
|
||||
Reference in New Issue
Block a user