国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - In which life cycle does vue introduce WeChat jssdk configuration to call the interface configuration?
為情所困
為情所困 2017-06-28 09:24:43
0
1
1174

Invalid signature error will be reported in ios, but it will be fine in Android, and it will be fine in WeChat developer tools
I tried to do wx.ready in create beforecreate mounted but always reported invalid signature. After closing this alert, the WeChat interface can be used. If encodeURIcomponent directly reports an error when calling the background interface, the background interface log parameters will also be in the style after encoding when the front end is not encoded. Please tell me what causes this.

為情所困
為情所困

reply all(1)
劉奇

Regarding WeChat signature errors, please refer to the official documentation, analyze the specific problems in detail, and check carefully according to the steps.
Then regarding initializing WeChat, if a single component is used, it is declared in mounted, or it can be declared globally in main.js .
Paste the general code I extracted:

export default {
  init() {
      let that = this;
      Service.wxConfig({//調(diào)用服務(wù)端獲取簽名配置
        url: location.href.split('#')[0]
      }, result => {
        if (result.success) {
          that.weixinConfig(result.data);
        }
      });
    },

    weixinConfig(data) {
      wx.config({
        debug: false,
        appId: data.appId,
        timestamp: data.timestamp,
        nonceStr: data.nonceStr,
        signature: data.signature,
        jsApiList: [
          'onMenuShareTimeline',
          'onMenuShareAppMessage',
          'showOptionMenu',
          'hideOptionMenu',
          'showMenuItems',
          'hideMenuItems',
          'chooseImage',
          'previewImage',
          'uploadImage',
          'chooseWXPay'
        ]
      });
    }
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template