I just started to learn the development of WeChat Mini Programs. When I get token, I need to get the code first.
in the video tutorial I watched, the teacher used a small code acquisition tool, but I couldn"t find the tool
find the example code of Wechat"s developer document for yourself
//app.js
App({
onLaunch: function() {
wx.login({
success: function(res) {
if (res.code) {
//
wx.request({
url: "https://test.com/onLogin",
data: {
code: res.code
}
})
} else {
console.log("" + res.errMsg)
}
}
});
}
})
does it not need to pass parameters such as appId, and how to pass them in? The first time I use it, I don"t have any ideas. Please give me a complete example. Thank you
why not write it in a form similar to the https://api.weixin.qq.com/sns.
URL, and get the