wx.chooseImage 在PC微信开发者工具里面没有调起摄像头,手机却可以,为什么?
发布于 4 年前 作者 jun47 6011 次浏览 来自 官方Issues

1.02.1909122 Windows 64Windows 32macOS

使用的是

开发版 Nightly Build

最新版本 64位的。

贴个代码:

wx.chooseVideo({

sourceType: [‘album’, ‘camera’],

maxDuration: 60,

camera: ‘front’,

success(res) {

console.log(res.tempFilePath)

wx.uploadFile({

url: http://192.168.43.72/test2, //仅为示例,非真实的接口地址

filePath: res.tempFilePath,

name: ‘file’,

formData: {

‘user’: ‘test’

},

success(res) {

const data = res.data

//do something

}

})

}

})

1 回复

开发工具不会调起摄像头的。如果你也不想在手机调起,设置这个属性

回到顶部