@nger/fk-upload 1.0.214 → 1.0.217
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/dist/main.js +1 -13
- package/dist/services/fk.service.js +12 -12
- package/dist/tasks/download-task.js +1 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
@@ -7,25 +7,13 @@ require("reflect-metadata");
|
|
7
7
|
require('dotenv').config();
|
8
8
|
const main_1 = require("@nger/main");
|
9
9
|
const core_1 = require("@nger/core");
|
10
|
-
const sirv_1 = require("@nger/sirv");
|
11
|
-
const rest_1 = require("@nger/rest");
|
12
|
-
const upload_1 = require("@nger/upload");
|
13
|
-
const rabbitmq_1 = require("@nger/rabbitmq");
|
14
10
|
const fk_upload_module_1 = require("./fk-upload.module");
|
15
|
-
const menu_1 = require("@nger/menu");
|
16
|
-
const setting_1 = require("@nger/setting");
|
17
11
|
let AppModule = class AppModule {
|
18
12
|
};
|
19
13
|
AppModule = tslib_1.__decorate([
|
20
14
|
(0, core_1.Module)({
|
21
15
|
imports: [
|
22
|
-
|
23
|
-
sirv_1.SirvModule.forRoot(),
|
24
|
-
rest_1.RestModule,
|
25
|
-
upload_1.UploadModule,
|
26
|
-
fk_upload_module_1.FkUploadModule,
|
27
|
-
menu_1.MenuModule,
|
28
|
-
setting_1.SettingModule
|
16
|
+
fk_upload_module_1.FkUploadModule
|
29
17
|
]
|
30
18
|
})
|
31
19
|
], AppModule);
|
@@ -99,7 +99,7 @@ let FkService = class FkService {
|
|
99
99
|
[`Cookie`]: fkAccount.cookies
|
100
100
|
}
|
101
101
|
}).then(res => res.data);
|
102
|
-
if (info.code === 200) {
|
102
|
+
if (info && info.code === 200) {
|
103
103
|
let forceDirect = true;
|
104
104
|
if (download.size > 2097152) {
|
105
105
|
forceDirect = false;
|
@@ -219,19 +219,19 @@ let FkService = class FkService {
|
|
219
219
|
}).catch((e) => {
|
220
220
|
sub.error(e);
|
221
221
|
});
|
222
|
-
if (uploadResult
|
223
|
-
if (uploadResult.
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
222
|
+
if (uploadResult) {
|
223
|
+
if (uploadResult.code !== 200) {
|
224
|
+
if (uploadResult.data) {
|
225
|
+
const data = uploadResult.data;
|
226
|
+
if (data.limit) {
|
227
|
+
// to big
|
228
|
+
sub.error(`文件太大上传失败`);
|
229
|
+
break;
|
230
|
+
}
|
229
231
|
}
|
232
|
+
sub.error(new Error(uploadResult.msg));
|
233
|
+
break;
|
230
234
|
}
|
231
|
-
sub.error(new Error(uploadResult.msg));
|
232
|
-
break;
|
233
|
-
}
|
234
|
-
if (uploadResult) {
|
235
235
|
const data = uploadResult.data;
|
236
236
|
const fullDownUrl = data.fullDownUrl;
|
237
237
|
if (fullDownUrl) {
|
@@ -109,9 +109,8 @@ class DownloadTask extends rabbitmq_1.Task {
|
|
109
109
|
const headers = resp.headers;
|
110
110
|
total = Number(headers["content-length"]);
|
111
111
|
if (total > 1024 * 1024 * 1024) {
|
112
|
-
sub.error(new Error(`文件超出1G`));
|
113
|
-
await _defer;
|
114
112
|
await db.manager.update(download_task_1.FkDownloadTask, download.id, { isBigFile: true, desc: '文件超出1G', status: `6` });
|
113
|
+
sub.error(new Error(`文件超出1G`));
|
115
114
|
return;
|
116
115
|
}
|
117
116
|
const useSize = download.w7Account.fkAccount.usedSize + total;
|