|
@@ -169,27 +169,13 @@ export default {
|
|
|
const file = new File([blob], 'canvasImage.png', { type: 'image/png' })
|
|
|
const query = new FormData()
|
|
|
query.append('file', file)
|
|
|
- const { data, error } = await uploadImg(query)
|
|
|
- if (error) {
|
|
|
- console.log('错误')
|
|
|
- return
|
|
|
- }
|
|
|
+ const { data } = await uploadImg(query)
|
|
|
this.$emit('photo', data, img)
|
|
|
} catch (error) {
|
|
|
- console.log(132, error)
|
|
|
+ this.loading = false
|
|
|
+ this.showImg = false
|
|
|
+ this.$emit('error', error.message)
|
|
|
}
|
|
|
- // setTimeout(async () => {
|
|
|
- // const face = await this.detectFaceShape(img)
|
|
|
- // this.loading = false
|
|
|
- // if (!face) {
|
|
|
- // window.alert('请拍摄清晰的人脸照片')
|
|
|
- // // return
|
|
|
- // }
|
|
|
- // // this.showImg = false
|
|
|
- // // this.$emit('photo', face, img)
|
|
|
- // // this.$modal.show('face')
|
|
|
- // // window.alert(face)
|
|
|
- // }, 3000)
|
|
|
}
|
|
|
// handleReTake () {
|
|
|
// this.src = ''
|