sa-token-plugin-tide 0.1.5

Tide framework integration for sa-token-rust - All-in-one package
Documentation

sa-token-plugin-tide

为 Tide 框架提供 sa-token 认证和授权支持 Provides sa-token authentication and authorization support for Tide framework

特性 | Features

  • ✨ 一行导入所有功能 | One-line import for all functionalities
  • 🔧 支持多种存储后端 | Support for multiple storage backends
  • 🚀 简化的中间件集成 | Simplified middleware integration
  • 📦 包含核心、宏、存储 | Includes core, macros, and storage

快速开始 | Quick Start

[dependencies]
sa-token-plugin-tide = "0.1.5"
use sa_token_plugin_tide::*;

#[async_std::main]
async fn main() -> tide::Result<()> {
    let storage = Arc::new(MemoryStorage::new());
    
    SaTokenConfig::builder()
        .token_name("Authorization")
        .timeout(7200)
        .storage(storage)
        .build();
    
    let mut app = tide::new();
    app.at("/login").post(login_handler);
    app.at("/user").get(user_info_handler);
    
    app.listen("127.0.0.1:8080").await?;
    Ok(())
}