feat(auth): 添加沙箱测试用 mock_login 接口 (GET /api/mock-login)

This commit is contained in:
2026-04-23 13:11:10 +08:00
parent 502ae8babb
commit ea705f0917
3 changed files with 131 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ use handlers::{
admin_get_user, admin_update_user_payment, add_favorite, alipay_notify, alipay_pay_page,
create_order, delete_weather, generate_temp_token_handler, get_current_user_profile,
get_favorites, get_user_quota, get_weather_brief, get_weather_details,
health_check, login, mock_confirm, payment_index, payment_page, payment_success,
health_check, login, mock_login, mock_confirm, payment_index, payment_page, payment_success,
post_weather_data,
refresh_token, remove_favorite, root, save_user_profile, serve_static_files,
};
@@ -72,6 +72,7 @@ fn create_server_config(
.service(web::resource("/static/{tail:.*}").route(web::get().to(serve_static_files)))
// API 接口
.service(login) // #[post("/api/login")]
.service(mock_login) // #[get("/api/mock-login")](沙箱测试用)
.service(refresh_token) // #[post("/api/refresh-token")](公开接口,无需认证)
.service(get_weather_details) // #[get("/weather/details")](支持 JWT 或 temp_token公开接口
.service(health_check) // #[get("/health")](公开接口,无需认证)