全局文件管理API?
发布于 4 年前 作者 changxiulan 4963 次浏览 来自 问答
let cam = wx.createCameraContext(), form = t.data.formData
        cam.takePhoto({
            success(e) {
                // todo 拍照后的处理
                let fmg = wx.getFileSystemManager(), filePath = e.tempImagePath
                console.log(filePath, typeof filePath )
                fmg.saveFileSync({
                    tempFilePath: filePath,
                    filePath:'temp.png',
                    success(e){
                        console.log(e)
                    }
                })
                // fmg.readFileSync({
                //     filePath: filePath,
                //     encoding: 'base64',
                //     success(e) {
                //         console.log(e)
                //         form.image = e.data
                //         c.post('real/idCardCheck', form, function (e) {
                //             console.log(e)
                //         })
                //     },
                //     fail(e) {
                //         console.log(e)
                //     }
                // })
                
            }

})

回到顶部