uploadFile报错unable to verify the first certificat?
发布于 7 年前 作者 jiehan 6273 次浏览 来自 问答

使用wx.uploadFile时,URL采用本机的一个链接API接口;但无法访问;老报unable to verify the first certificat;这是为什么?

代码就是基础的样例代码;

wx.uploadFile({

url: 'https://localhost:44325/Server/ServerFood', // 仅为示例,非真实的接口地址

filePath: that.data.Images_Address,

name: 'upload',

formData: {

user: 'test'

},

success(res) {

console.log('success', res.data, res.statusCode)

// do something

},

fail(res) {

const data = res.data

wx.showModal({

title: 'fail',

content: 'fail',

})

// do something

}

})

1 回复

本机配置的https证书不对,证书验证失败。

你测试的话用http方式访问localhost试试

回到顶部