[][src]Struct wechat_mp::WechatConfig

pub struct WechatConfig {
    pub echo_token: String,
    pub key: Option<Vec<u8>>,
    pub app_id: String,
    pub app_secret: String,
    pub oauth_redirect_url: String,
}

微信基本配置

Fields

echo_token: String

对接的token

key: Option<Vec<u8>>

加密的密钥

app_id: String

app id

app_secret: String

app secret

oauth_redirect_url: String

1、在微信公众号请求用户网页授权之前,开发者需要先到公众平台官网中的 “开发 - 接口权限 - 网页服务 - 网页帐号 - 网页授权获取用户基本信息”的配置选项中,修改授权回调域名。 请注意,这里填写的是域名(是一个字符串),而不是URL,因此请勿加 http:// 等协议头;

授权回调域名配置规范为全域名,比如需要网页授权的域名为:www.qq.com, 配置以后此域名下面的页面http://www.qq.com/music.html 、 http://www.qq.com/login.html 都可以进行OAuth2.0鉴权。 但http://pay.qq.com 、 http://music.qq.com 、 http://qq.com 无法进行OAuth2.0鉴权

Implementations

impl WechatConfig[src]

pub fn decode_aes_key(
    key: &String
) -> Result<Option<Vec<u8>>, WechatEncryptError>
[src]

pub fn new(
    key: Option<Vec<u8>>,
    app_id: String,
    app_secret: String,
    echo_token: String,
    oauth_redirect_url: String
) -> Self
[src]

Trait Implementations

impl Clone for WechatConfig[src]

impl Debug for WechatConfig[src]

impl Default for WechatConfig[src]

impl<'de> Deserialize<'de> for WechatConfig[src]

impl Serialize for WechatConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Interface for T where
    T: Send + Sync + Any
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ModuleInterface for T where
    T: Send + Sync + Any
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,