日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

微信登陸失敗Error: invalid code

作者:hellolipop 更新時間: 2022-04-04 編程語言

僅限自己學習開發案例
發送到自己的服務器進行微信登陸驗證

    async wxLogin(e) {
      // 獲取到code
      let resLogin = await wx.login()
      // 獲取個人信息
      // let res = await wx.getUserInfo()
      const data = {
        code: resLogin.code,
        encryptedData: e.detail.encryptedData,
        iv: e.detail.iv,
        rawData: e.detail.rawData,
        signature: e.detail.signature
      }
      let res = await featch({
        url: 'users/wxlogin',
        method: 'POST',
        data: data
      })
      console.log(res)
    }

在這里插入圖片描述
這是因為后臺的appid和appsecret是不同的,更改服務器中對應的值換成自己的就行了

原文鏈接:https://blog.csdn.net/weixin_45366905/article/details/107086732

欄目分類
最近更新