返回error code,官方文档说是因为token过期,不知道怎么解决或改代码
const grant_type = 'client_credentials'
const client_id = xxxxxx'
const client_secret = 'dxxxxxxx'
var token = null
var base64 = null
var apiUrl = null
Page({
data: {
imageUrl: "",
message: '欢迎使用动物识别',
load_logo: 'waiting',
load_title: "等待上传图片",
load_message: " 请上传图片",
btn_enable:true,
test:22
},
onReady: function(res) {
wx.request({
url: 'https:
method: 'POST',
success: function (res) {
console.log('Request successful !')
token = res.data.access_token;
console.log('My token is : ' + token);
},
fail: function (res) {
console.log('Fail to request !')
console.log(res)
}
})
},
返回的error code