Trait WechatMethod

Source
pub trait WechatMethod {
    // Required methods
    fn check(&mut self) -> bool;
    fn login(&mut self, code: &str) -> Result<JsonValue, String>;
    fn getuserinfo(&mut self, code: &str) -> Result<JsonValue, String>;

    // Provided methods
    fn code2_session(&mut self, code: &str) -> Result<JsonValue, String> { ... }
    fn get_phone_number(
        &mut self,
        iv: &str,
        _encrypted_data: &str,
        _session_key: &str,
    ) -> Result<JsonValue, String> { ... }
}

Required Methods§

Source

fn check(&mut self) -> bool

服务状态检测

Source

fn login(&mut self, code: &str) -> Result<JsonValue, String>

登录

Source

fn getuserinfo(&mut self, code: &str) -> Result<JsonValue, String>

code 获取用户信息 企业微信只能拿到userid

Provided Methods§

Source

fn code2_session(&mut self, code: &str) -> Result<JsonValue, String>

小程序登录

Source

fn get_phone_number( &mut self, iv: &str, _encrypted_data: &str, _session_key: &str, ) -> Result<JsonValue, String>

小程序获取手机号

Implementors§