pub struct AuthApi { /* private fields */ }Expand description
登录与用户信息 API 门面
Implementations§
Source§impl AuthApi
impl AuthApi
Sourcepub async fn code2session(
&self,
js_code: impl AsRef<str>,
) -> Result<Code2SessionResponse, MpError>
pub async fn code2session( &self, js_code: impl AsRef<str>, ) -> Result<Code2SessionResponse, MpError>
登录凭证校验(code2session)
Sourcepub async fn check_session(
&self,
openid: impl AsRef<str>,
session_key: impl AsRef<str>,
) -> Result<(), MpError>
pub async fn check_session( &self, openid: impl AsRef<str>, session_key: impl AsRef<str>, ) -> Result<(), MpError>
检验登录态
Sourcepub async fn reset_session(
&self,
openid: impl AsRef<str>,
session_key: impl AsRef<str>,
) -> Result<ResetSessionResponse, MpError>
pub async fn reset_session( &self, openid: impl AsRef<str>, session_key: impl AsRef<str>, ) -> Result<ResetSessionResponse, MpError>
重置登录态
Sourcepub async fn get_phone_number(
&self,
code: impl AsRef<str>,
openid: Option<&str>,
) -> Result<PhoneNumberResponse, MpError>
pub async fn get_phone_number( &self, code: impl AsRef<str>, openid: Option<&str>, ) -> Result<PhoneNumberResponse, MpError>
获取手机号
Sourcepub async fn get_plugin_openpid(
&self,
code: impl AsRef<str>,
) -> Result<PluginOpenPidResponse, MpError>
pub async fn get_plugin_openpid( &self, code: impl AsRef<str>, ) -> Result<PluginOpenPidResponse, MpError>
获取插件用户 openpid
Sourcepub async fn check_encrypted_msg(
&self,
encrypted_msg_hash: impl AsRef<str>,
) -> Result<CheckEncryptedMsgResponse, MpError>
pub async fn check_encrypted_msg( &self, encrypted_msg_hash: impl AsRef<str>, ) -> Result<CheckEncryptedMsgResponse, MpError>
检查加密信息
Sourcepub async fn get_paid_unionid(
&self,
params: &GetPaidUnionidParams,
) -> Result<String, MpError>
pub async fn get_paid_unionid( &self, params: &GetPaidUnionidParams, ) -> Result<String, MpError>
支付后获取 UnionId
Sourcepub async fn get_user_encrypt_key(
&self,
openid: impl AsRef<str>,
session_key: impl AsRef<str>,
) -> Result<GetUserEncryptKeyResponse, MpError>
pub async fn get_user_encrypt_key( &self, openid: impl AsRef<str>, session_key: impl AsRef<str>, ) -> Result<GetUserEncryptKeyResponse, MpError>
获取用户 encryptKey
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AuthApi
impl !UnwindSafe for AuthApi
impl Freeze for AuthApi
impl Send for AuthApi
impl Sync for AuthApi
impl Unpin for AuthApi
impl UnsafeUnpin for AuthApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more