yggdrasil/src/main.rs
xfy 6df0a7ee19 US-006: 验证 + 修复编译和运行时问题
- 修复 migration: role 从 ENUM 改为 VARCHAR(20) 以兼容 tokio-postgres
- 修复 Cargo.toml: 将 chrono/argon2/uuid/rand 改为非 optional,添加 wasm-bindgen/getrandom js
- 修复 main.rs: Tokio runtime panic,改用 std::thread + Runtime::new
- 修复 db/mod.rs wasm stub: DummyPool 替代 deadpool_postgres
- 修复 login/admin.rs: wasm_bindgen::JsCast 条件编译
- 验证通过: 注册✓ 登录✓ get_current_user✓ 重复注册拒绝✓ 错误密码✓

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:49:43 +08:00

26 lines
457 B
Rust

use dioxus::prelude::*;
mod api;
mod auth;
mod db;
mod models;
mod pages;
mod router;
mod tasks;
mod theme;
use router::AppRouter;
fn main() {
#[cfg(feature = "server")]
{
dotenvy::dotenv().ok();
std::thread::spawn(|| {
let rt = tokio::runtime::Runtime::new().expect("Failed to create Tokio runtime");
rt.block_on(tasks::session_cleanup::run_cleanup());
});
}
dioxus::launch(AppRouter);
}