component-shipinlv 1.1.26 → 1.3.0
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/VideoPublish/account-manage/home.js +24 -4
- package/dist/VideoPublish/account-manage/list.d.ts +1 -0
- package/dist/VideoPublish/account-manage/list.js +68 -24
- package/dist/VideoPublish/account-manage/setting/index.js +43 -4
- package/dist/VideoPublish/log/index.js +90 -44
- package/dist/VideoPublish/log/index.less +1 -1
- package/dist/VideoPublish/publish-task-plan/index.js +14 -2
- package/dist/VideoPublish/publish-task-plan/tool-bak.txt +219 -0
- package/dist/VideoPublish/publish-task-plan/tool.d.ts +14 -4
- package/dist/VideoPublish/publish-task-plan/tool.js +301 -83
- package/dist/VideoPublish/video-account/index.js +5 -2
- package/dist/active-code/index.d.ts +1 -0
- package/dist/active-code/index.js +5 -2
- package/dist/base/folderCreate.d.ts +2 -0
- package/dist/base/folderCreate.js +56 -0
- package/dist/component/folder-select.d.ts +1 -0
- package/dist/component/folder-select.js +46 -12
- package/dist/component/param.d.ts +5 -0
- package/dist/component/param.js +9 -0
- package/dist/component/sse.d.ts +11 -0
- package/dist/component/sse.js +66 -0
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/lib/Tool.js +2 -2
- package/dist/lib/accountManageSettingConfig.js +3 -1
- package/dist/lib/event.js +2 -2
- package/dist/lib/getApiUrl.d.ts +1 -0
- package/dist/lib/getApiUrl.js +9 -1
- package/dist/lib/openChrome.d.ts +2 -0
- package/dist/lib/openChrome.js +115 -0
- package/dist/lib/request.js +1 -1
- package/dist/lib/user-agent.d.ts +2 -0
- package/dist/lib/user-agent.js +10 -0
- package/dist/lib/video-api/open-chrome.d.ts +2 -0
- package/dist/lib/video-api/open-chrome.js +49 -0
- package/dist/renewal-vip/index.d.ts +1 -1
- package/dist/renewal-vip/index.js +6 -4
- package/dist/service/local/FileController.d.ts +3 -0
- package/dist/service/local/FileController.js +59 -32
- package/dist/service/video-api/VideoApiOpenChromeController.d.ts +1 -0
- package/dist/service/video-api/VideoApiOpenChromeController.js +27 -0
- package/dist/types/ApiLocal.d.ts +19 -0
- package/dist/types/ApiLocal.js +0 -0
- package/dist/types/OpenChrome.d.ts +16 -0
- package/dist/types/OpenChrome.js +0 -0
- package/dist/types/PublishTaskPlan.d.ts +7 -1
- package/dist/types/PublishVideo.d.ts +11 -0
- package/dist/types/PublishVideo.js +0 -0
- package/dist/types/VideoPublishLog.d.ts +4 -1
- package/dist/typings/LocalFile.d.ts +3 -0
- package/dist/typings/VideoPublishAccountManageSetting.d.ts +1 -0
- package/dist/typings/VideoPublishVideoAccount.d.ts +3 -0
- package/dist/window.d.ts +1 -0
- package/package.json +1 -1
@@ -5,38 +5,81 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
7
7
|
import * as VideoPublishCrawlerTaskController from "../../service/api/VideoPublishCrawlerTaskController";
|
8
|
+
import * as VideoPublishVideoAccountController from "../../service/api/VideoPublishVideoAccountController";
|
8
9
|
import sleep from "../../lib/sleep";
|
9
10
|
import event from "../../lib/event";
|
10
11
|
import AccountManageSettingConfig from "../../lib/accountManageSettingConfig";
|
12
|
+
import SSE from "../../component/sse";
|
13
|
+
import param from "../../component/param";
|
14
|
+
import { notification } from "antd";
|
15
|
+
import openChrome from "../../lib/openChrome";
|
11
16
|
var PublishTaskPlanClass = /*#__PURE__*/function () {
|
12
17
|
function PublishTaskPlanClass(env) {
|
13
18
|
var clientIdentity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
19
|
+
var options = arguments.length > 2 ? arguments[2] : undefined;
|
14
20
|
_classCallCheck(this, PublishTaskPlanClass);
|
15
21
|
_defineProperty(this, "timeLoopMillisecond", 15 * 1e3);
|
16
22
|
_defineProperty(this, "isPublishing", false);
|
17
23
|
_defineProperty(this, "env", '');
|
18
24
|
_defineProperty(this, "clientIdentity", '');
|
25
|
+
_defineProperty(this, "options", {
|
26
|
+
// onVideoPublish: ( proxyInfo, query ) => {
|
27
|
+
// return Promise.resolve( true );
|
28
|
+
// },
|
29
|
+
onLog: function onLog() {}
|
30
|
+
});
|
19
31
|
this.env = env;
|
20
32
|
this.clientIdentity = clientIdentity;
|
33
|
+
this.options = options;
|
21
34
|
}
|
22
35
|
_createClass(PublishTaskPlanClass, [{
|
23
36
|
key: "onInit",
|
24
37
|
value: function onInit() {
|
25
|
-
var
|
26
|
-
_window$getBridge,
|
27
|
-
_window,
|
28
|
-
_window$getBridge$onL;
|
38
|
+
var _this2 = this;
|
29
39
|
setInterval(function () {
|
30
|
-
if (
|
40
|
+
if (_this2.isPublishing) {
|
31
41
|
return;
|
32
42
|
}
|
33
|
-
|
43
|
+
_this2.getWork();
|
34
44
|
}, 2e3);
|
35
45
|
|
36
|
-
//
|
37
|
-
|
38
|
-
|
46
|
+
// chrome 提交的 用户信息;
|
47
|
+
event.on('ws-message.chrome-publish-video-account-info', function (result) {
|
48
|
+
if (result.dataType !== 'chrome-publish-video-account-info') {
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
console.log('ws-message chrome account:', result);
|
52
|
+
var data = result.data;
|
53
|
+
VideoPublishVideoAccountController.create(data, {
|
54
|
+
env: _this2.env
|
55
|
+
});
|
39
56
|
});
|
57
|
+
|
58
|
+
// event.on('ws-message.publish-video-log-publish-video', async ( query: ApiLocal.DataFlowResult<PublishVideo.PublishVideoLog> ) => {
|
59
|
+
// if( query.dataType !== 'publish-video-log-publish-video' ){
|
60
|
+
// return;
|
61
|
+
// }
|
62
|
+
// const data: PublishVideo.PublishVideoLog = query.data;
|
63
|
+
// if( ! ['fail', 'success'].includes( data.status ) ){
|
64
|
+
// return;
|
65
|
+
// }
|
66
|
+
//
|
67
|
+
// await this.on Report( data.status === 'success', data.message, {
|
68
|
+
// taskType: data.taskType,
|
69
|
+
// taskId: data.taskId,
|
70
|
+
// platform: data.platform,
|
71
|
+
// platformAccountId: '',
|
72
|
+
// }).catch( err => {
|
73
|
+
//
|
74
|
+
// });
|
75
|
+
//
|
76
|
+
// await this.doWorkWait();
|
77
|
+
// });
|
78
|
+
|
79
|
+
// 桥
|
80
|
+
// this.options.onLog?.( ( query: any ) => {
|
81
|
+
// event.run('shipinlv-video-publish-log', query )
|
82
|
+
// });
|
40
83
|
}
|
41
84
|
}, {
|
42
85
|
key: "getWork",
|
@@ -84,8 +127,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
84
127
|
key: "doWork",
|
85
128
|
value: function () {
|
86
129
|
var _doWork = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(taskDetail) {
|
87
|
-
var
|
88
|
-
var item, saveBaseData, result, errMessage, errLog;
|
130
|
+
var item, saveBaseData, result, errMessage, code, errLog;
|
89
131
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
90
132
|
while (1) switch (_context2.prev = _context2.next) {
|
91
133
|
case 0:
|
@@ -111,42 +153,41 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
111
153
|
platformAccountId: taskDetail.platformVideoAccountId
|
112
154
|
};
|
113
155
|
_context2.t0 = item.taskType;
|
114
|
-
_context2.next = _context2.t0 === "publish-video" ? 12 :
|
156
|
+
_context2.next = _context2.t0 === "publish-video" ? 12 : 20;
|
115
157
|
break;
|
116
158
|
case 12:
|
117
159
|
if (item.publishVideo) {
|
118
160
|
_context2.next = 16;
|
119
161
|
break;
|
120
162
|
}
|
121
|
-
console.warn("item
|
122
|
-
this.onReport(false, "publishVideo 不存在", saveBaseData);
|
163
|
+
console.warn("item publishVideo is empty!");
|
164
|
+
this.onReport(false, '', "publishVideo 不存在", saveBaseData);
|
123
165
|
return _context2.abrupt("break", 26);
|
124
166
|
case 16:
|
125
167
|
_context2.next = 18;
|
126
|
-
return this.onPublishVideo(taskDetail.platform, taskDetail.platformVideoAccountId, taskDetail.taskInfo, taskDetail.proxyInfo).catch(function (err) {
|
168
|
+
return this.onPublishVideo(taskDetail.platform, taskDetail.platformVideoAccountId, taskDetail.nickname, taskDetail.chromeProfileName, taskDetail.taskInfo, taskDetail.proxyInfo).catch(function (err) {
|
127
169
|
console.warn("onPublishVideo err:", err);
|
128
|
-
|
170
|
+
// this.on Report(false, err?.message, saveBaseData );
|
129
171
|
});
|
130
172
|
case 18:
|
131
173
|
result = _context2.sent;
|
132
|
-
if (result) {
|
133
|
-
this.onReport(result.success, result.message, saveBaseData);
|
134
|
-
}
|
135
174
|
return _context2.abrupt("break", 26);
|
136
|
-
case
|
175
|
+
case 20:
|
137
176
|
errMessage = '暂不支持 类型:' + item.taskType;
|
138
177
|
console.log(errMessage);
|
178
|
+
code = 'not-support-task-type';
|
139
179
|
errLog = {
|
140
180
|
platform: taskDetail.platform,
|
141
181
|
platformAccountId: taskDetail.platformVideoAccountId,
|
142
|
-
code:
|
182
|
+
code: code,
|
183
|
+
nickname: taskDetail.nickname,
|
143
184
|
message: errMessage,
|
144
185
|
status: 'fail',
|
145
186
|
taskId: item.taskId,
|
146
187
|
eventType: 'task-kind'
|
147
188
|
};
|
148
189
|
this.onLog(errLog);
|
149
|
-
this.onReport(false, errMessage, saveBaseData);
|
190
|
+
this.onReport(false, code, errMessage, saveBaseData);
|
150
191
|
case 26:
|
151
192
|
_context2.next = 28;
|
152
193
|
return this.doWorkWait();
|
@@ -168,12 +209,13 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
168
209
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
169
210
|
while (1) switch (_context3.prev = _context3.next) {
|
170
211
|
case 0:
|
171
|
-
event.run('
|
172
|
-
|
212
|
+
event.run('publish-video-log-publish-video', query);
|
213
|
+
this.options.onLog(query);
|
214
|
+
case 2:
|
173
215
|
case "end":
|
174
216
|
return _context3.stop();
|
175
217
|
}
|
176
|
-
}, _callee3);
|
218
|
+
}, _callee3, this);
|
177
219
|
}));
|
178
220
|
function onLog(_x2) {
|
179
221
|
return _onLog.apply(this, arguments);
|
@@ -204,9 +246,12 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
204
246
|
}()
|
205
247
|
}, {
|
206
248
|
key: "onReport",
|
207
|
-
value: function onReport(success,
|
208
|
-
|
249
|
+
value: function onReport(success, code,
|
250
|
+
// not-login
|
251
|
+
message, saveBaseData) {
|
252
|
+
return VideoPublishCrawlerTaskController.report(_objectSpread({
|
209
253
|
success: success,
|
254
|
+
code: code,
|
210
255
|
message: message
|
211
256
|
}, saveBaseData), {
|
212
257
|
env: this.env
|
@@ -242,27 +287,30 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
242
287
|
}, {
|
243
288
|
key: "onPublishVideo",
|
244
289
|
value: function () {
|
245
|
-
var _onPublishVideo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
290
|
+
var _onPublishVideo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(platform, platformVideoAccountId, nickname, chromeProfileName, taskInfo, proxyInfo) {
|
246
291
|
var _this3 = this;
|
247
|
-
|
248
|
-
|
292
|
+
var _this;
|
293
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
294
|
+
while (1) switch (_context8.prev = _context8.next) {
|
249
295
|
case 0:
|
250
|
-
|
296
|
+
_this = this; // 发布抖音视频
|
297
|
+
_context8.next = 3;
|
251
298
|
return sleep(1);
|
252
|
-
case
|
253
|
-
return
|
254
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
255
|
-
var
|
256
|
-
|
257
|
-
|
258
|
-
while (1) switch (_context6.prev = _context6.next) {
|
299
|
+
case 3:
|
300
|
+
return _context8.abrupt("return", new Promise( /*#__PURE__*/function () {
|
301
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(resolve, reject) {
|
302
|
+
var settingConfig, publishResult, finishLog;
|
303
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
304
|
+
while (1) switch (_context7.prev = _context7.next) {
|
259
305
|
case 0:
|
260
306
|
settingConfig = AccountManageSettingConfig();
|
261
307
|
console.log('settingConfig 1:', settingConfig);
|
262
|
-
|
263
|
-
return
|
308
|
+
_context7.next = 4;
|
309
|
+
return _this.onPublishVideoDo(proxyInfo, {
|
264
310
|
platformVideoAccountId: platformVideoAccountId,
|
265
311
|
platform: platform,
|
312
|
+
chromeProfileName: chromeProfileName,
|
313
|
+
nickname: nickname,
|
266
314
|
open: settingConfig.isChromeOpen,
|
267
315
|
// 发布视频的时候是否打开图形界面
|
268
316
|
taskInfo: taskInfo
|
@@ -279,71 +327,241 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
279
327
|
// kindTagValue: detail.kindTagValue, // "" // 抖音是商品链接 快手是商品relItemId
|
280
328
|
// }
|
281
329
|
// },
|
282
|
-
}).catch(function (
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
330
|
+
}, settingConfig).catch( /*#__PURE__*/function () {
|
331
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err) {
|
332
|
+
var _err$message;
|
333
|
+
var msgInfo, code, message, errLog, errNew;
|
334
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
335
|
+
while (1) switch (_context6.prev = _context6.next) {
|
336
|
+
case 0:
|
337
|
+
// 基本不会到这里
|
338
|
+
console.warn('bridge. video Publish err:', err.code, err);
|
339
|
+
msgInfo = (err === null || err === void 0 || (_err$message = err.message) === null || _err$message === void 0 ? void 0 : _err$message.split('■')) || [];
|
340
|
+
code = '';
|
341
|
+
message = '';
|
342
|
+
if (msgInfo.length >= 2) {
|
343
|
+
code = msgInfo[0];
|
344
|
+
message = msgInfo.slice(1).join(' ');
|
345
|
+
} else {
|
346
|
+
message = (err === null || err === void 0 ? void 0 : err.message) || '';
|
347
|
+
}
|
348
|
+
errLog = {
|
349
|
+
platform: platform,
|
350
|
+
platformAccountId: platformVideoAccountId,
|
351
|
+
code: code,
|
352
|
+
message: message,
|
353
|
+
nickname: nickname,
|
354
|
+
status: 'fail',
|
355
|
+
taskId: taskInfo.taskId,
|
356
|
+
eventType: 'publish-video'
|
357
|
+
}; // event.run('lo g', errLog);
|
358
|
+
_this3.onLog(errLog);
|
359
|
+
_this3.onReport(false, code, err === null || err === void 0 ? void 0 : err.message, {
|
360
|
+
taskType: taskInfo.taskType,
|
361
|
+
taskId: taskInfo.taskId,
|
362
|
+
platform: platform,
|
363
|
+
platformAccountId: platformVideoAccountId
|
364
|
+
});
|
365
|
+
|
366
|
+
// 等一会,清理现场,关闭 chrome
|
367
|
+
_context6.next = 10;
|
368
|
+
return sleep(10e3);
|
369
|
+
case 10:
|
370
|
+
errNew = new Error(err === null || err === void 0 ? void 0 : err.message);
|
371
|
+
errNew.name = err.code;
|
372
|
+
reject(errNew);
|
373
|
+
|
374
|
+
// resolve( err );
|
375
|
+
case 13:
|
376
|
+
case "end":
|
377
|
+
return _context6.stop();
|
378
|
+
}
|
379
|
+
}, _callee6);
|
380
|
+
}));
|
381
|
+
return function (_x11) {
|
382
|
+
return _ref2.apply(this, arguments);
|
383
|
+
};
|
384
|
+
}());
|
287
385
|
case 4:
|
288
|
-
publishResult =
|
386
|
+
publishResult = _context7.sent;
|
289
387
|
if (publishResult) {
|
290
|
-
|
388
|
+
_context7.next = 8;
|
291
389
|
break;
|
292
390
|
}
|
293
|
-
|
294
|
-
|
391
|
+
console.log('publishResult empty');
|
392
|
+
return _context7.abrupt("return", publishResult);
|
393
|
+
case 8:
|
295
394
|
console.log("publishResult:", publishResult);
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
code: publishResult.code,
|
304
|
-
message: publishResult.message,
|
305
|
-
status: 'fail',
|
395
|
+
finishLog = {
|
396
|
+
platform: platform,
|
397
|
+
platformAccountId: platformVideoAccountId,
|
398
|
+
code: '',
|
399
|
+
message: '恭喜你,视频发布成功',
|
400
|
+
nickname: nickname,
|
401
|
+
status: 'success',
|
306
402
|
taskId: taskInfo.taskId,
|
307
403
|
eventType: 'publish-video'
|
308
404
|
}; // event.run('lo g', errLog);
|
309
|
-
_this3.onLog(
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
405
|
+
_this3.onLog(finishLog);
|
406
|
+
_context7.next = 13;
|
407
|
+
return sleep(1);
|
408
|
+
case 13:
|
409
|
+
_this3.onReport(true, '', '', {
|
410
|
+
taskType: taskInfo.taskType,
|
411
|
+
taskId: taskInfo.taskId,
|
412
|
+
platform: platform,
|
413
|
+
platformAccountId: platformVideoAccountId
|
414
|
+
});
|
315
415
|
|
316
|
-
//
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
// taskId: 0,
|
323
|
-
// eventType: 'task-kind'
|
324
|
-
// }
|
325
|
-
// event.run('lo g', logReceive);
|
326
|
-
case 15:
|
416
|
+
// 等一会,清理现场,关闭 chrome
|
417
|
+
_context7.next = 16;
|
418
|
+
return sleep(10e3);
|
419
|
+
case 16:
|
420
|
+
resolve(true);
|
421
|
+
case 17:
|
327
422
|
case "end":
|
328
|
-
return
|
423
|
+
return _context7.stop();
|
329
424
|
}
|
330
|
-
},
|
425
|
+
}, _callee7);
|
331
426
|
}));
|
332
|
-
return function (
|
427
|
+
return function (_x9, _x10) {
|
333
428
|
return _ref.apply(this, arguments);
|
334
429
|
};
|
335
430
|
}()));
|
336
|
-
case
|
431
|
+
case 4:
|
337
432
|
case "end":
|
338
|
-
return
|
433
|
+
return _context8.stop();
|
339
434
|
}
|
340
|
-
},
|
435
|
+
}, _callee8, this);
|
341
436
|
}));
|
342
|
-
function onPublishVideo(_x3, _x4, _x5, _x6) {
|
437
|
+
function onPublishVideo(_x3, _x4, _x5, _x6, _x7, _x8) {
|
343
438
|
return _onPublishVideo.apply(this, arguments);
|
344
439
|
}
|
345
440
|
return onPublishVideo;
|
346
441
|
}()
|
442
|
+
}, {
|
443
|
+
key: "onPublishVideoDo",
|
444
|
+
value: function () {
|
445
|
+
var _onPublishVideoDo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(proxyInfo, query, settingConfig) {
|
446
|
+
var _this;
|
447
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
448
|
+
while (1) switch (_context9.prev = _context9.next) {
|
449
|
+
case 0:
|
450
|
+
_this = this;
|
451
|
+
return _context9.abrupt("return", new Promise(function (resolve, reject) {
|
452
|
+
var isOpened = false;
|
453
|
+
var sse = new SSE("http://localhost:".concat(window.__ShipinlvLocalServerPort || 61806, "/").concat("chrome/applyForPublishTaskSse".toLocaleLowerCase(), "?") + param({
|
454
|
+
data: JSON.stringify(_objectSpread(_objectSpread({}, query), {}, {
|
455
|
+
proxyInfo: proxyInfo
|
456
|
+
}))
|
457
|
+
}), function (lastEventId, data) {
|
458
|
+
if (lastEventId === 'start-do-task') {
|
459
|
+
//唤起 浏览器;
|
460
|
+
// event.run('publish-video-open-chrome', {
|
461
|
+
// platform: query.platform || 'douyin',
|
462
|
+
// platformAccountId: query.platformVideoAccountId,
|
463
|
+
// chromePath: settingConfig.chromePath,
|
464
|
+
// isOpen: query.open,
|
465
|
+
// });
|
466
|
+
_this.onLog({
|
467
|
+
platform: query.platform || 'douyin',
|
468
|
+
platformAccountId: query.platformVideoAccountId,
|
469
|
+
code: '',
|
470
|
+
nickname: query.nickname,
|
471
|
+
message: "<Divider orientation=\"left\">\u89C6\u9891\u8D26\u53F7\uFF1A".concat(query.nickname, "</Divider>"),
|
472
|
+
status: '',
|
473
|
+
taskId: query.taskInfo.taskId,
|
474
|
+
eventType: 'publish-video'
|
475
|
+
});
|
476
|
+
_this.onLog({
|
477
|
+
platform: query.platform || 'douyin',
|
478
|
+
platformAccountId: query.platformVideoAccountId,
|
479
|
+
code: '',
|
480
|
+
nickname: query.nickname,
|
481
|
+
message: '接到任务,准备启动 谷歌浏览器',
|
482
|
+
status: '',
|
483
|
+
taskId: query.taskInfo.taskId,
|
484
|
+
eventType: 'publish-video'
|
485
|
+
});
|
486
|
+
openChrome({
|
487
|
+
action: 'publish',
|
488
|
+
platform: query.platform || 'douyin',
|
489
|
+
platformAccountId: query.platformVideoAccountId,
|
490
|
+
nickname: query.nickname,
|
491
|
+
url: 'https://creator.douyin.com/creator-micro/home',
|
492
|
+
chromePath: settingConfig.chromePath,
|
493
|
+
chromeProfileName: query.chromeProfileName,
|
494
|
+
isOpen: query.open
|
495
|
+
}, false);
|
496
|
+
} else if (lastEventId === 'fail') {
|
497
|
+
// query.onDownFail( data );
|
498
|
+
// this.on Report( false, data, {
|
499
|
+
// taskType: query.taskInfo.taskType,
|
500
|
+
// taskId: query.taskInfo.taskId,
|
501
|
+
// platform: query.platform || 'douyin',
|
502
|
+
// platformAccountId: query.platformVideoAccountId,
|
503
|
+
// });
|
504
|
+
var failErr = new Error(data);
|
505
|
+
reject(failErr);
|
506
|
+
} else if (lastEventId === 'finish') {
|
507
|
+
// _this.onLog( {
|
508
|
+
// platform: query.platform || 'douyin',
|
509
|
+
// platformAccountId: query.platformVideoAccountId,
|
510
|
+
// code: '',
|
511
|
+
// message: data,
|
512
|
+
// status: 'success',
|
513
|
+
// taskId: query.taskInfo.taskId,
|
514
|
+
// eventType: 'publish-video',
|
515
|
+
// });
|
516
|
+
|
517
|
+
resolve(true);
|
518
|
+
} else {
|
519
|
+
// @ts-ignore
|
520
|
+
var status = "".concat(lastEventId);
|
521
|
+
_this.onLog({
|
522
|
+
platform: query.platform || 'douyin',
|
523
|
+
platformAccountId: query.platformVideoAccountId,
|
524
|
+
code: '',
|
525
|
+
nickname: query.nickname,
|
526
|
+
message: data,
|
527
|
+
status: status,
|
528
|
+
taskId: query.taskInfo.taskId,
|
529
|
+
eventType: 'publish-video'
|
530
|
+
});
|
531
|
+
}
|
532
|
+
}, function () {
|
533
|
+
isOpened = true;
|
534
|
+
}, function () {}, function (err) {
|
535
|
+
console.log('down file err:', err);
|
536
|
+
var description = '发布客户端似乎不正常,请检查:' + (err === null || err === void 0 ? void 0 : err.message);
|
537
|
+
if (!isOpened) {
|
538
|
+
notification.error({
|
539
|
+
duration: 30 * 60,
|
540
|
+
message: "发布失败",
|
541
|
+
description: description
|
542
|
+
});
|
543
|
+
}
|
544
|
+
// _this?.on Report( false, description, {
|
545
|
+
// taskType: query.taskInfo.taskType,
|
546
|
+
// taskId: query.taskInfo.taskId,
|
547
|
+
// platform: query.platform || 'douyin',
|
548
|
+
// platformAccountId: query.platformVideoAccountId,
|
549
|
+
// });
|
550
|
+
});
|
551
|
+
|
552
|
+
sse.onInit();
|
553
|
+
}));
|
554
|
+
case 2:
|
555
|
+
case "end":
|
556
|
+
return _context9.stop();
|
557
|
+
}
|
558
|
+
}, _callee9, this);
|
559
|
+
}));
|
560
|
+
function onPublishVideoDo(_x12, _x13, _x14) {
|
561
|
+
return _onPublishVideoDo.apply(this, arguments);
|
562
|
+
}
|
563
|
+
return onPublishVideoDo;
|
564
|
+
}()
|
347
565
|
}]);
|
348
566
|
return PublishTaskPlanClass;
|
349
567
|
}();
|
@@ -191,7 +191,7 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
|
|
191
191
|
var current = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : pagination.current;
|
192
192
|
return VideoPublishController.videoAccountList(_objectSpread(_objectSpread({}, postQuery), {}, {
|
193
193
|
current: current,
|
194
|
-
pageSize:
|
194
|
+
pageSize: pagination.pageSize
|
195
195
|
}), {
|
196
196
|
env: env
|
197
197
|
});
|
@@ -302,7 +302,10 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
|
|
302
302
|
loading: false,
|
303
303
|
columns: columns,
|
304
304
|
dataSource: listData,
|
305
|
-
pagination: pagination
|
305
|
+
pagination: pagination,
|
306
|
+
onChange: function onChange(page, filters, sorter, extra) {
|
307
|
+
runVideoAccount(query, page.current || 1);
|
308
|
+
}
|
306
309
|
})
|
307
310
|
});
|
308
311
|
};
|
@@ -8,13 +8,16 @@ import updateUserInfo from "../lib/updateUserInfo";
|
|
8
8
|
import Tool from "../lib/Tool";
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
10
|
var UserProfileVipCard = function UserProfileVipCard(_ref) {
|
11
|
-
var
|
11
|
+
var env = _ref.env,
|
12
|
+
onActive = _ref.onActive;
|
12
13
|
var _Form$useForm = Form.useForm(),
|
13
14
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
14
15
|
form = _Form$useForm2[0];
|
15
16
|
var _useRequest = useRequest(function (vipCardCode) {
|
16
17
|
return VipCardController.activate({
|
17
18
|
vipCardCode: vipCardCode
|
19
|
+
}, {
|
20
|
+
env: env
|
18
21
|
});
|
19
22
|
}, {
|
20
23
|
manual: true,
|
@@ -51,7 +54,7 @@ var UserProfileVipCard = function UserProfileVipCard(_ref) {
|
|
51
54
|
required: true,
|
52
55
|
message: '请输入'
|
53
56
|
}, {
|
54
|
-
pattern: /^\s*(
|
57
|
+
pattern: /^\s*([a-z0-9]+-)?[A-Z0-9-]{14,}\s*$/i,
|
55
58
|
message: '类似:AI-AAAA-BBBB-CCCC'
|
56
59
|
}],
|
57
60
|
children: /*#__PURE__*/_jsx(Input, {
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
|
+
import * as LocalFileController from "../service/local/FileController";
|
4
|
+
var folderCreate = /*#__PURE__*/function () {
|
5
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(folderPath) {
|
6
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
7
|
+
while (1) switch (_context2.prev = _context2.next) {
|
8
|
+
case 0:
|
9
|
+
return _context2.abrupt("return", new Promise( /*#__PURE__*/function () {
|
10
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
|
11
|
+
var openResult;
|
12
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
13
|
+
while (1) switch (_context.prev = _context.next) {
|
14
|
+
case 0:
|
15
|
+
_context.next = 2;
|
16
|
+
return LocalFileController.folderCreate({
|
17
|
+
folderPath: folderPath
|
18
|
+
}, {
|
19
|
+
silent: true
|
20
|
+
}).catch(function (err) {
|
21
|
+
if ((err === null || err === void 0 ? void 0 : err.name) === "shipinlv-client-not-run") {
|
22
|
+
return reject(err);
|
23
|
+
}
|
24
|
+
console.log('create In Folder err:', err);
|
25
|
+
console.log('create In Folder err 2:', JSON.stringify(err));
|
26
|
+
err.message = "\u521B\u5EFA\u6587\u4EF6\u5939\u5931\u8D25\uFF1A".concat(err === null || err === void 0 ? void 0 : err.message);
|
27
|
+
reject(err);
|
28
|
+
});
|
29
|
+
case 2:
|
30
|
+
openResult = _context.sent;
|
31
|
+
if (openResult) {
|
32
|
+
resolve({
|
33
|
+
folderPath: folderPath
|
34
|
+
});
|
35
|
+
}
|
36
|
+
case 4:
|
37
|
+
case "end":
|
38
|
+
return _context.stop();
|
39
|
+
}
|
40
|
+
}, _callee);
|
41
|
+
}));
|
42
|
+
return function (_x2, _x3) {
|
43
|
+
return _ref2.apply(this, arguments);
|
44
|
+
};
|
45
|
+
}()));
|
46
|
+
case 1:
|
47
|
+
case "end":
|
48
|
+
return _context2.stop();
|
49
|
+
}
|
50
|
+
}, _callee2);
|
51
|
+
}));
|
52
|
+
return function folderCreate(_x) {
|
53
|
+
return _ref.apply(this, arguments);
|
54
|
+
};
|
55
|
+
}();
|
56
|
+
export default folderCreate;
|