文章目录
一、获取不限制的小程序码
获取不限制的小程序码一般情况下是由后端来提供接口的
官方文档地址:获取不限制的小程序码
请求事例:POST https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN
1、第一步:需要先获取ACCESS_TOKEN
官方文档地址:获取接口调用凭据
以下代码注意:需要补充自己的
appid
以及微信小程序密钥
<template>
<view class="" @click="getAccessToken">获取Access_Token</view>
</template>
<script>
export default{
data(){
return{
access_token: "",
}
},
mounted(){
},
methods:{
getAccessToken() {
let that = this
uni.request({
// https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=你的APPID&secret=你的微信小程序密钥
url: 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=你的APPID&secret=你的微信小程序密钥',
method: "GET",
success(res) {
that.access_token = res.data.access_token
},
fail(err) {
co