@nger/fk-upload 1.0.197 → 1.0.201
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,14 +2,12 @@
|
|
2
2
|
import { Config } from '@nger/core';
|
3
3
|
import { Db } from '@nger/typeorm';
|
4
4
|
import { Context } from 'koa';
|
5
|
-
import { BrowserWindow } from 'electron';
|
6
5
|
import { W7DataSource } from '@nger/w7';
|
7
6
|
export declare class TaskManageController {
|
8
7
|
private db;
|
9
8
|
private config;
|
10
|
-
private win;
|
11
9
|
private w7;
|
12
|
-
constructor(db: Db, config: Config,
|
10
|
+
constructor(db: Db, config: Config, w7: W7DataSource);
|
13
11
|
toUrl(query: any): string;
|
14
12
|
createPages(total: number, query: any, page: number): {
|
15
13
|
index: number;
|
@@ -24,17 +24,15 @@ function getStatusTitle(status) {
|
|
24
24
|
return '未知';
|
25
25
|
}
|
26
26
|
}
|
27
|
-
|
27
|
+
// import { BrowserWindow } from 'electron'
|
28
28
|
const w7_1 = require("@nger/w7");
|
29
29
|
let TaskManageController = class TaskManageController {
|
30
30
|
db;
|
31
31
|
config;
|
32
|
-
win;
|
33
32
|
w7;
|
34
|
-
constructor(db, config,
|
33
|
+
constructor(db, config, w7) {
|
35
34
|
this.db = db;
|
36
35
|
this.config = config;
|
37
|
-
this.win = win;
|
38
36
|
this.w7 = w7;
|
39
37
|
}
|
40
38
|
toUrl(query) {
|
@@ -249,13 +247,12 @@ let TaskManageController = class TaskManageController {
|
|
249
247
|
react_1.default.createElement("script", { src: "/@nger/fk-upload/static/task-manage.js?t=" + new Date().getTime() }));
|
250
248
|
}
|
251
249
|
downloadFile(url, back, ctx) {
|
252
|
-
if (this.win) {
|
253
|
-
|
254
|
-
|
255
|
-
}
|
256
|
-
|
257
|
-
|
258
|
-
}
|
250
|
+
// if (this.win) {
|
251
|
+
// this.win.webContents.downloadURL(url)
|
252
|
+
// ctx.redirect(back)
|
253
|
+
// } else {
|
254
|
+
// }
|
255
|
+
ctx.redirect(url);
|
259
256
|
}
|
260
257
|
staticTaskManage(ctx) {
|
261
258
|
try {
|
@@ -312,6 +309,6 @@ tslib_1.__decorate([
|
|
312
309
|
], TaskManageController.prototype, "finishTask", null);
|
313
310
|
TaskManageController = tslib_1.__decorate([
|
314
311
|
(0, core_1.Controller)(`@nger/fk-upload`),
|
315
|
-
tslib_1.__metadata("design:paramtypes", [typeorm_1.Db, core_1.Config,
|
312
|
+
tslib_1.__metadata("design:paramtypes", [typeorm_1.Db, core_1.Config, w7_1.W7DataSource])
|
316
313
|
], TaskManageController);
|
317
314
|
exports.TaskManageController = TaskManageController;
|
@@ -42,6 +42,10 @@ class EffectTask extends rabbitmq_1.Task {
|
|
42
42
|
}
|
43
43
|
const w7 = injector.get(w7_1.W7DataSource);
|
44
44
|
let uploadUrl = task.uploadUrl;
|
45
|
+
if (!(uploadUrl && uploadUrl.length > 0)) {
|
46
|
+
await complete();
|
47
|
+
return next && next();
|
48
|
+
}
|
45
49
|
if (uploadUrl.includes('s21i.faiusr.com')) {
|
46
50
|
uploadUrl = uploadUrl.replace('s21i.faiusr.com', 's21v.faiusr.com');
|
47
51
|
}
|
@@ -55,7 +59,7 @@ class EffectTask extends rabbitmq_1.Task {
|
|
55
59
|
await (0, fs_extra_1.unlink)(filePath);
|
56
60
|
}
|
57
61
|
catch (e) { }
|
58
|
-
await w7.manager.update(w7_1.W7ChatTopicEntity, task.topicId, { topicStyle: 7, thirdUrl: item.url, foreverUrl:
|
62
|
+
await w7.manager.update(w7_1.W7ChatTopicEntity, task.topicId, { topicStyle: 7, thirdUrl: item.url, foreverUrl: uploadUrl });
|
59
63
|
await complete();
|
60
64
|
}
|
61
65
|
else {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nger/fk-upload",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.201",
|
4
4
|
"description": "nger fk upload",
|
5
5
|
"main": "dist/electon.js",
|
6
6
|
"types": "dist/core.d.ts",
|
@@ -39,15 +39,9 @@
|
|
39
39
|
"react": "^18.1.0",
|
40
40
|
"request": "^2.88.2"
|
41
41
|
},
|
42
|
-
"devDependencies": {
|
43
|
-
"electron": "^18.2.3"
|
44
|
-
},
|
45
42
|
"scripts": {
|
46
43
|
"tsc": "tsc",
|
47
|
-
"tsc:build": "tsc"
|
48
|
-
"electron": "electron .",
|
49
|
-
"pack": "electron-builder --dir",
|
50
|
-
"dist": "electron-builder --win --ia32"
|
44
|
+
"tsc:build": "tsc"
|
51
45
|
},
|
52
46
|
"readme": "## admin\n\n## account\n\n## test url -- \n\n## \n\nhttp://kaifa2.jidujiaowang.com/web/index.php?c=site&a=entry&eid=8&version_id=0\nadmin888\n12345678"
|
53
47
|
}
|