wx_applet 0.0.2

微信小程序的rust接口封装
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::env;

use anyhow::Result;
use wx_applet::auth::code2session::{code2session, Code2Seccion};

#[tokio::test]
async fn main() -> Result<()> {
    dotenvy::dotenv()?;
    let app_id = env::var("APPID").expect("Can't find the app_id");
    let secret = env::var("SECRET").expect("Can't find the secret");
    let code = env::var("CODE").expect("Can't find the code");
    let session = Code2Seccion::new(app_id, secret, code.to_owned());
    let result = code2session(&session).await;
    println!("Result is:{:?}", result);

    Ok(())
}