MCPcopy Create free account
hub / github.com/bailicangdu/node-elm / uploadImg

Method uploadImg

prototype/baseComponent.js:79–96  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

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) => {

Callers

nothing calls this directly

Calls 1

getPathMethod · 0.95

Tested by

no test coverage detected