@nger/fk-upload 1.0.19 → 1.0.22

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.
@@ -170,6 +170,7 @@ 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);
173
174
  formdata.append('fileName', task.filename);
174
175
  formdata.append(`totalSize`, `${task.total}`);
175
176
  formdata.append(`fileMd5`, task.fileMd5);
@@ -200,8 +201,10 @@ let TaskService = class TaskService {
200
201
  });
201
202
  this.redis.set(task.filename, `${task.index + 1}`);
202
203
  if (data) {
203
- const downUrl = data.downUrl;
204
+ // fullDownUrl
205
+ const downUrl = data.fullDownUrl;
204
206
  if (downUrl) {
207
+ const fullUrl = downUrl.startsWith('http') ? downUrl : `https://` + downUrl;
205
208
  this.redis.del(task.filename);
206
209
  this.ws.send({
207
210
  action: `@nger/fk-upload/uploading`,
@@ -209,17 +212,17 @@ let TaskService = class TaskService {
209
212
  uploadSize: task.end,
210
213
  filename: task.filename,
211
214
  total: task.total,
212
- uploadUrl: `https://` + downUrl
215
+ uploadUrl: fullUrl
213
216
  }
214
217
  });
215
218
  this.addEffectTask({
216
219
  filename: task.filename,
217
- uploadUrl: `https://` + downUrl,
220
+ uploadUrl: fullUrl,
218
221
  topicId: task.topicId
219
222
  });
220
223
  this.db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, {
221
224
  status: 2,
222
- uploadUrl: `https://` + downUrl,
225
+ uploadUrl: fullUrl,
223
226
  uploadSize: task.total
224
227
  }).then(() => complete()).catch(() => fail());
225
228
  }
@@ -253,7 +256,6 @@ let TaskService = class TaskService {
253
256
  obs.subscribe({
254
257
  next: async ([data, complete, fail]) => {
255
258
  const task = JSON.parse(data);
256
- console.log(task);
257
259
  const download = await this.db.manager.findOne(entities_1.FkDownloadTaskEntity, { where: { filename: task.filename } });
258
260
  if (download) {
259
261
  let total = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.19",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",