Authored by huangyCode

新增上传接口

... ... @@ -9,6 +9,7 @@ const router = express.Router(); // eslint-disable-line
const multipartMiddleware = multipart();
router.post('/xianyu/upload/idcard', multipartMiddleware, upload.uploadIdCard);
router.post('/xianyu/upload/im', multipartMiddleware, upload.uploadIdIm);
router.get('/xianyu/passport/login/taobao', passport.login.taobaoLogin);
router.get('/xianyu/passport/callback/taobao', passport.login.taobaoCallback);
... ...
... ... @@ -71,6 +71,15 @@ const uploadIdCard = (req, res, next) => {
}).then(res.json).catch(next);
}
const uploadIdIm = (req, res, next) => {
upload({
files: req.files && req.files.file || [],
type: 'image',
bucket: 'imserver'
}).then(res.json).catch(next);
}
module.exports = {
uploadIdCard
uploadIdCard,
uploadIdIm
};
... ...