component-shipinlv 1.1.27 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/dist/VideoPublish/account-manage/home.js +25 -4
  2. package/dist/VideoPublish/account-manage/list.d.ts +1 -0
  3. package/dist/VideoPublish/account-manage/list.js +69 -24
  4. package/dist/VideoPublish/account-manage/setting/index.js +43 -4
  5. package/dist/VideoPublish/log/index.js +90 -44
  6. package/dist/VideoPublish/log/index.less +1 -1
  7. package/dist/VideoPublish/publish-task-plan/index.js +14 -2
  8. package/dist/VideoPublish/publish-task-plan/tool-bak.txt +219 -0
  9. package/dist/VideoPublish/publish-task-plan/tool.d.ts +14 -4
  10. package/dist/VideoPublish/publish-task-plan/tool.js +302 -83
  11. package/dist/VideoPublish/video-account/index.js +5 -2
  12. package/dist/base/folderCreate.d.ts +2 -0
  13. package/dist/base/folderCreate.js +56 -0
  14. package/dist/component/folder-select.d.ts +1 -0
  15. package/dist/component/folder-select.js +46 -12
  16. package/dist/component/param.d.ts +5 -0
  17. package/dist/component/param.js +9 -0
  18. package/dist/component/sse.d.ts +11 -0
  19. package/dist/component/sse.js +66 -0
  20. package/dist/component/video-platform/logo.js +4 -2
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +1 -0
  23. package/dist/lib/Tool.d.ts +1 -1
  24. package/dist/lib/Tool.js +3 -2
  25. package/dist/lib/event.js +2 -2
  26. package/dist/lib/getApiUrl.d.ts +1 -0
  27. package/dist/lib/getApiUrl.js +9 -1
  28. package/dist/lib/openChrome.d.ts +2 -0
  29. package/dist/lib/openChrome.js +141 -0
  30. package/dist/lib/request.js +1 -1
  31. package/dist/lib/user-agent.d.ts +2 -0
  32. package/dist/lib/user-agent.js +10 -0
  33. package/dist/lib/video-api/open-chrome.d.ts +2 -0
  34. package/dist/lib/video-api/open-chrome.js +49 -0
  35. package/dist/lib/video-api/quit-chrome.d.ts +2 -0
  36. package/dist/lib/video-api/quit-chrome.js +51 -0
  37. package/dist/service/local/FileController.d.ts +3 -0
  38. package/dist/service/local/FileController.js +59 -32
  39. package/dist/service/video-api/VideoApiOpenChromeController.d.ts +2 -0
  40. package/dist/service/video-api/VideoApiOpenChromeController.js +50 -0
  41. package/dist/types/ApiLocal.d.ts +19 -0
  42. package/dist/types/ApiLocal.js +0 -0
  43. package/dist/types/ChromeOperate.d.ts +22 -0
  44. package/dist/types/ChromeOperate.js +0 -0
  45. package/dist/types/PublishTaskPlan.d.ts +7 -1
  46. package/dist/types/PublishVideo.d.ts +11 -0
  47. package/dist/types/PublishVideo.js +0 -0
  48. package/dist/types/VideoPublishLog.d.ts +4 -1
  49. package/dist/typings/LocalFile.d.ts +3 -0
  50. package/dist/typings/VideoPublishAccountManageSetting.d.ts +1 -0
  51. package/dist/typings/VideoPublishVideoAccount.d.ts +3 -0
  52. package/dist/window.d.ts +1 -0
  53. 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 _this = this,
26
- _window$getBridge,
27
- _window,
28
- _window$getBridge$onL;
38
+ var _this2 = this;
29
39
  setInterval(function () {
30
- if (_this.isPublishing) {
40
+ if (_this2.isPublishing) {
31
41
  return;
32
42
  }
33
- _this.getWork();
43
+ _this2.getWork();
34
44
  }, 2e3);
35
45
 
36
- //
37
- (_window$getBridge = (_window = window).getBridge) === null || _window$getBridge === void 0 || (_window$getBridge = _window$getBridge.call(_window)) === null || _window$getBridge === void 0 || (_window$getBridge$onL = _window$getBridge.onLog) === null || _window$getBridge$onL === void 0 || _window$getBridge$onL.call(_window$getBridge, function (query) {
38
- event.run('shipinlv-video-publish-log', query);
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 _this2 = this;
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 : 21;
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.publishVideo is empty!");
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
- _this2.onReport(false, err === null || err === void 0 ? void 0 : err.message, saveBaseData);
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 21:
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: 'not-support-task-type',
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('shipinlv-video-publish-log', query);
172
- case 1:
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, message, saveBaseData) {
208
- VideoPublishCrawlerTaskController.report(_objectSpread({
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 _callee7(platform, platformVideoAccountId, taskInfo, proxyInfo) {
290
+ var _onPublishVideo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(platform, platformVideoAccountId, nickname, chromeProfileName, taskInfo, proxyInfo) {
246
291
  var _this3 = this;
247
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
248
- while (1) switch (_context7.prev = _context7.next) {
292
+ var _this;
293
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
294
+ while (1) switch (_context8.prev = _context8.next) {
249
295
  case 0:
250
- _context7.next = 2;
296
+ _this = this; // 发布抖音视频
297
+ _context8.next = 3;
251
298
  return sleep(1);
252
- case 2:
253
- return _context7.abrupt("return", new Promise( /*#__PURE__*/function () {
254
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(resolve, reject) {
255
- var _window$getBridge2, _window2;
256
- var settingConfig, publishResult, errLog, err;
257
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
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
- _context6.next = 4;
263
- return (_window$getBridge2 = (_window2 = window).getBridge) === null || _window$getBridge2 === void 0 ? void 0 : _window$getBridge2.call(_window2).videoPublish(proxyInfo, {
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,242 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
279
327
  // kindTagValue: detail.kindTagValue, // "" // 抖音是商品链接 快手是商品relItemId
280
328
  // }
281
329
  // },
282
- }).catch(function (err) {
283
- // 基本不会到这里
284
- console.warn('bridge. video Publish err:', err.code, err);
285
- resolve(err);
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 = _context6.sent;
386
+ publishResult = _context7.sent;
289
387
  if (publishResult) {
290
- _context6.next = 7;
388
+ _context7.next = 8;
291
389
  break;
292
390
  }
293
- return _context6.abrupt("return", publishResult);
294
- case 7:
391
+ console.log('publishResult empty');
392
+ return _context7.abrupt("return", publishResult);
393
+ case 8:
295
394
  console.log("publishResult:", publishResult);
296
- if (publishResult.success) {
297
- _context6.next = 14;
298
- break;
299
- }
300
- errLog = {
301
- platform: publishResult.data.platform,
302
- platformAccountId: publishResult.data.platformVideoAccountId,
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(errLog);
310
- err = new Error(publishResult.message);
311
- err.name = publishResult.code;
312
- return _context6.abrupt("return", reject(err));
313
- case 14:
314
- resolve(publishResult);
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
- // const logReceive: Log.Receive = {
317
- // platform: publishResult.data.platform,
318
- // platformAccountId: publishResult.data.platformVideoAccountId,
319
- // code: 'publish-video-finish',
320
- // message: '',
321
- // status: 'success',
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 _context6.stop();
423
+ return _context7.stop();
329
424
  }
330
- }, _callee6);
425
+ }, _callee7);
331
426
  }));
332
- return function (_x7, _x8) {
427
+ return function (_x9, _x10) {
333
428
  return _ref.apply(this, arguments);
334
429
  };
335
430
  }()));
336
- case 3:
431
+ case 4:
337
432
  case "end":
338
- return _context7.stop();
433
+ return _context8.stop();
339
434
  }
340
- }, _callee7);
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
+ taskId: query.taskInfo.taskId,
492
+ url: 'https://creator.douyin.com/creator-micro/home',
493
+ chromePath: settingConfig.chromePath,
494
+ chromeProfileName: query.chromeProfileName,
495
+ isOpen: query.open
496
+ }, false);
497
+ } else if (lastEventId === 'fail') {
498
+ // query.onDownFail( data );
499
+ // this.on Report( false, data, {
500
+ // taskType: query.taskInfo.taskType,
501
+ // taskId: query.taskInfo.taskId,
502
+ // platform: query.platform || 'douyin',
503
+ // platformAccountId: query.platformVideoAccountId,
504
+ // });
505
+ var failErr = new Error(data);
506
+ reject(failErr);
507
+ } else if (lastEventId === 'finish') {
508
+ // _this.onLog( {
509
+ // platform: query.platform || 'douyin',
510
+ // platformAccountId: query.platformVideoAccountId,
511
+ // code: '',
512
+ // message: data,
513
+ // status: 'success',
514
+ // taskId: query.taskInfo.taskId,
515
+ // eventType: 'publish-video',
516
+ // });
517
+
518
+ resolve(true);
519
+ } else {
520
+ // @ts-ignore
521
+ var status = "".concat(lastEventId);
522
+ _this.onLog({
523
+ platform: query.platform || 'douyin',
524
+ platformAccountId: query.platformVideoAccountId,
525
+ code: '',
526
+ nickname: query.nickname,
527
+ message: data,
528
+ status: status,
529
+ taskId: query.taskInfo.taskId,
530
+ eventType: 'publish-video'
531
+ });
532
+ }
533
+ }, function () {
534
+ isOpened = true;
535
+ }, function () {}, function (err) {
536
+ console.log('down file err:', err);
537
+ var description = '发布客户端似乎不正常,请检查:' + (err === null || err === void 0 ? void 0 : err.message);
538
+ if (!isOpened) {
539
+ notification.error({
540
+ duration: 30 * 60,
541
+ message: "发布失败",
542
+ description: description
543
+ });
544
+ }
545
+ // _this?.on Report( false, description, {
546
+ // taskType: query.taskInfo.taskType,
547
+ // taskId: query.taskInfo.taskId,
548
+ // platform: query.platform || 'douyin',
549
+ // platformAccountId: query.platformVideoAccountId,
550
+ // });
551
+ });
552
+
553
+ sse.onInit();
554
+ }));
555
+ case 2:
556
+ case "end":
557
+ return _context9.stop();
558
+ }
559
+ }, _callee9, this);
560
+ }));
561
+ function onPublishVideoDo(_x12, _x13, _x14) {
562
+ return _onPublishVideoDo.apply(this, arguments);
563
+ }
564
+ return onPublishVideoDo;
565
+ }()
347
566
  }]);
348
567
  return PublishTaskPlanClass;
349
568
  }();
@@ -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: 20
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
  };
@@ -0,0 +1,2 @@
1
+ declare const folderCreate: (folderPath: string) => Promise<LocalFile.FileCreate>;
2
+ export default folderCreate;
@@ -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;
@@ -9,6 +9,7 @@ interface Props {
9
9
  label?: React.ReactNode;
10
10
  placeholder?: string;
11
11
  disabled?: boolean;
12
+ autoCreateDirName?: string;
12
13
  onBeforeSelect?: () => Promise<boolean>;
13
14
  hiddenOpenDir?: boolean;
14
15
  disabledChangeDir?: boolean;