uploadFile报错unable to verify the first certificat?

发布于 9 年前作者 jiehan6418 次浏览最后编辑 9 年前来自 ask

使用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 回复
xshi
xshi1 楼6 年前

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

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