exodus-framework 2.0.99997 → 2.0.99999
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/middlewares/file.js
CHANGED
@@ -26,7 +26,7 @@ class FileMiddleware extends _controller.default {
|
|
26
26
|
},
|
27
27
|
filename: (req, file, cb) => {
|
28
28
|
// const name = Date.now() + path.extname(file.originalname);
|
29
|
-
const name = Date.now() + '_
|
29
|
+
const name = Date.now() + '_@_' + file.originalname;
|
30
30
|
cb(null, name);
|
31
31
|
}
|
32
32
|
});
|
package/lib/services/express.js
CHANGED
@@ -31,6 +31,9 @@ class ExpressService extends _service.default {
|
|
31
31
|
await super.onStartCluster();
|
32
32
|
const expss = (0, _express.default)();
|
33
33
|
this.server = http.createServer(expss);
|
34
|
+
expss.use((0, _cors.default)({
|
35
|
+
origin: '*'
|
36
|
+
}));
|
34
37
|
expss.use('/public', _express.default.static(_core.default.settings.getHttp().publicPath));
|
35
38
|
expss.use((0, _pinoHttp.pinoHttp)({
|
36
39
|
logger: _logger.default.logger()
|
@@ -44,9 +47,6 @@ class ExpressService extends _service.default {
|
|
44
47
|
extended: true,
|
45
48
|
limit: '10mb'
|
46
49
|
}));
|
47
|
-
expss.use((0, _cors.default)({
|
48
|
-
origin: '*'
|
49
|
-
}));
|
50
50
|
expss.use(this.mainRouter);
|
51
51
|
expss.use(this.handleAuthorizationFailure.bind(this));
|
52
52
|
expss.use(this.handleNotFoud.bind(this));
|
@@ -120,7 +120,7 @@ class FileLibraryService extends _service.default {
|
|
120
120
|
const metaFilePath = _path.default.join(this.path, `${md5}.meta`);
|
121
121
|
let originalName = _path.default.basename(filePath);
|
122
122
|
if (temporary) {
|
123
|
-
const split = originalName.split('_
|
123
|
+
const split = originalName.split('_@_');
|
124
124
|
originalName = split[split.length - 1];
|
125
125
|
}
|
126
126
|
await _fsExtra.default.move(filePath, newFilePath, {
|