You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.6 KiB
52 lines
1.6 KiB
'use strict';
|
|
const request = require('superagent');
|
|
const parse = require('async-busboy');
|
|
const path = require('path')
|
|
const fs = require('fs');
|
|
const uuid = require('uuid');
|
|
|
|
const UploadPath = {
|
|
project: ['.txt', '.dwg', '.doc', '.docx', '.xls', '.xlsx', ".csv", '.pdf', '.pptx', '.png', '.jpg', '.svg', '.rar', '.zip', '.jpeg', '.mp4'],
|
|
report: ['.doc', '.docx', '.xls', '.xlsx', ".csv", '.pdf'],
|
|
data: ['.txt', '.xls', '.xlsx', ".csv"],
|
|
image: ['.png', '.jpg', '.svg'],
|
|
three: ['.js'],
|
|
video: ['.mp4']
|
|
};
|
|
const ext = {
|
|
project: ['.txt', '.dwg', '.doc', '.docx', '.xls', '.xlsx', ".csv", '.pdf', '.pptx', '.png', '.jpg', '.svg', '.rar', '.zip', '.jpeg', '.mp4'],
|
|
report: [".doc", ".docx", ".xls", ".xlsx", ".pdf"],
|
|
data: [".txt", ".xls", ".xlsx"],
|
|
image: [".png", ".jpg", ".svg"],
|
|
three: [".js"],
|
|
video: [".mp4"],
|
|
bpmn: [".bpmn", ".bpmn20.xml", ".zip", ".bar"],
|
|
app: [".apk"]
|
|
}
|
|
|
|
module.exports = {
|
|
entry: function (app, router, opts) {
|
|
|
|
const getApiRoot = async function (ctx) {
|
|
const { apiUrl, axyApi, axyProject } = opts;
|
|
|
|
|
|
ctx.status = 200;
|
|
ctx.body = {
|
|
root: apiUrl,
|
|
axyApi: axyApi,
|
|
axyProject: axyProject
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// router.use(download_);
|
|
router.get('/api/root', getApiRoot);
|
|
// router.post('/_upload/new', upload);
|
|
// router.delete('/_upload/cleanup', remove);
|
|
// router.post('/_upload/attachments/ali/:p', uploadAliOSS);
|
|
// router.get('/_download/attachments/ali', downloadFromAli);
|
|
// router.post('/_upload/attachments/:p', upload_);
|
|
}
|
|
};
|
|
|