(req, res, next)
| 77 | } |
| 78 | |
| 79 | async uploadImg(req, res, next){ |
| 80 | const type = req.params.type; |
| 81 | try{ |
| 82 | //const image_path = await this.qiniu(req, type); |
| 83 | const image_path = await this.getPath(req, res); |
| 84 | res.send({ |
| 85 | status: 1, |
| 86 | image_path, |
| 87 | }) |
| 88 | }catch(err){ |
| 89 | console.log('上传图片失败', err); |
| 90 | res.send({ |
| 91 | status: 0, |
| 92 | type: 'ERROR_UPLOAD_IMG', |
| 93 | message: '上传图片失败' |
| 94 | }) |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | async getPath(req, res){ |
| 99 | return new Promise((resolve, reject) => { |