@nger/fk-upload 1.0.21 → 1.0.24

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.
@@ -27,6 +27,7 @@ export interface UploadTask {
27
27
  totalChunks: number;
28
28
  complete: boolean;
29
29
  topicId: number;
30
+ token: string;
30
31
  }
31
32
  import { ScheduleService } from '@nger/schedule';
32
33
  import { W7DataSource } from '@nger/w7';
@@ -170,7 +170,6 @@ let TaskService = class TaskService {
170
170
  formdata.append('isFreeVer', 'false');
171
171
  formdata.append('aid', `${task.aid}`);
172
172
  formdata.append('folderId', `${task.folderId}`);
173
- console.log(task.filename);
174
173
  formdata.append('fileName', task.filename);
175
174
  formdata.append(`totalSize`, `${task.total}`);
176
175
  formdata.append(`fileMd5`, task.fileMd5);
@@ -204,6 +203,20 @@ let TaskService = class TaskService {
204
203
  // fullDownUrl
205
204
  const downUrl = data.fullDownUrl;
206
205
  if (downUrl) {
206
+ const fullUrl = downUrl.startsWith('http') ? downUrl : `https:` + downUrl;
207
+ console.log(data);
208
+ axios_1.default.post(`https://smr00.vip.webportal.top/ajax/advanceUpload.jsp?cmd=_report&_TOKEN=${task.token}`, this.encodeURIComponent({
209
+ type: 1,
210
+ size: task.total,
211
+ time: NaN,
212
+ flag: true,
213
+ name: task.filename
214
+ }), {
215
+ headers: {
216
+ [`Content-Type`]: `application/x-www-form-urlencoded; charset=UTF-8`,
217
+ Cookie: task.cookies
218
+ }
219
+ });
207
220
  this.redis.del(task.filename);
208
221
  this.ws.send({
209
222
  action: `@nger/fk-upload/uploading`,
@@ -211,17 +224,17 @@ let TaskService = class TaskService {
211
224
  uploadSize: task.end,
212
225
  filename: task.filename,
213
226
  total: task.total,
214
- uploadUrl: `https://` + downUrl
227
+ uploadUrl: fullUrl
215
228
  }
216
229
  });
217
230
  this.addEffectTask({
218
231
  filename: task.filename,
219
- uploadUrl: `https://` + downUrl,
232
+ uploadUrl: fullUrl,
220
233
  topicId: task.topicId
221
234
  });
222
235
  this.db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, {
223
236
  status: 2,
224
- uploadUrl: `https://` + downUrl,
237
+ uploadUrl: fullUrl,
225
238
  uploadSize: task.total
226
239
  }).then(() => complete()).catch(() => fail());
227
240
  }
@@ -379,7 +392,8 @@ let TaskService = class TaskService {
379
392
  totalChunks: totalChunks,
380
393
  splitSize,
381
394
  complete,
382
- topicId: task.topicId
395
+ topicId: task.topicId,
396
+ token: token
383
397
  });
384
398
  index = index + 1;
385
399
  start = endSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.21",
3
+ "version": "1.0.24",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",