wx.request({ //獲取openid接口 url: 'https://api.weixin.qq.com/sns/jscode2session', data: { appid: appid, secret: appsecret, js_code: code, grant_type: 'authorization_code' }, method: 'GET', success: function (res) { console.log(res.data) OPEN_ID = res.data.openid;//獲取到的openid SESSION_KEY = res.data.session_key;//獲取到session_key console.log(OPEN_ID) console.log(SESSION_KEY) // that.setData({ // openid: res.data.openid.substr(0, 10) + '********' + res.data.openid.substr(res.data.openid.length - 8, res.data.openid.length), // session_key: res.data.session_key.substr(0, 8) + '********' + res.data.session_key.substr(res.data.session_key.length - 6, res.data.session_key.length) // }) } })添加request域名 提示為保障帳號安全不可使用此域名地址,請修改 這是為什么
請求openid 報 為保障帳號安全不可使用此域名地址,請修改 這是為什么
縹緲止盈
2018-10-10 16:12:29