ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
``` getAccessToken(){ //获取access_token this.$httpRequest('POST','/getAccessToken').then(res=>{ if(res&&res.status==200){ this.shareToken = res.access_token; this.getWxCode(res.access_token) } }) }, getWxCode(shareToken) { //获取小程序码 let that = this uni.showLoading({ title: '加载中', mask: true }) uni.request({ url: `https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=${shareToken}`, method: "POST", data: { access_token:shareToken, width: 280, path: 'pages/detail/detail?data='+this.detaiId }, responseType: 'arraybuffer', success: function(res) { uni.hideLoading(); let src = uni.arrayBufferToBase64(res.data); that.codeImg = 'data:image/png;base64,' + src; } }) }, ``` ~~~jsx getAccessToken(){ //获取access_token this.$httpRequest('POST','/getAccessToken').then(res=>{ if(res&&res.status==200){ this.shareToken = res.access_token; this.getWxCode(res.access_token) } }) }, getWxCode(shareToken) { //获取小程序码 let that = this uni.showLoading({ title: '加载中', mask: true }) uni.request({ url: `https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=${shareToken}`, method: "POST", data: { access_token:shareToken, width: 280, path: 'pages/detail/detail?data='+this.detaiId }, responseType: 'arraybuffer', success: function(res) { uni.hideLoading(); let src = uni.arrayBufferToBase64(res.data); that.codeImg = 'data:image/png;base64,' + src; } }) }, ~~~