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.
Files changed (53) hide show
  1. package/dist/VideoPublish/account-manage/home.js +24 -4
  2. package/dist/VideoPublish/account-manage/list.d.ts +1 -0
  3. package/dist/VideoPublish/account-manage/list.js +68 -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 +301 -83
  11. package/dist/VideoPublish/video-account/index.js +5 -2
  12. package/dist/active-code/index.d.ts +1 -0
  13. package/dist/active-code/index.js +5 -2
  14. package/dist/base/folderCreate.d.ts +2 -0
  15. package/dist/base/folderCreate.js +56 -0
  16. package/dist/component/folder-select.d.ts +1 -0
  17. package/dist/component/folder-select.js +46 -12
  18. package/dist/component/param.d.ts +5 -0
  19. package/dist/component/param.js +9 -0
  20. package/dist/component/sse.d.ts +11 -0
  21. package/dist/component/sse.js +66 -0
  22. package/dist/lib/Tool.d.ts +1 -1
  23. package/dist/lib/Tool.js +2 -2
  24. package/dist/lib/accountManageSettingConfig.js +3 -1
  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 +115 -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/renewal-vip/index.d.ts +1 -1
  36. package/dist/renewal-vip/index.js +6 -4
  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 +1 -0
  40. package/dist/service/video-api/VideoApiOpenChromeController.js +27 -0
  41. package/dist/types/ApiLocal.d.ts +19 -0
  42. package/dist/types/ApiLocal.js +0 -0
  43. package/dist/types/OpenChrome.d.ts +16 -0
  44. package/dist/types/OpenChrome.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,241 @@ 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
+ 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: 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
  };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
+ env?: Global.Env | '';
3
4
  onActive: () => void;
4
5
  }
5
6
  declare const UserProfileVipCard: React.FC<Props>;
@@ -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 onActive = _ref.onActive;
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*(AI\d-)?[A-Z0-9-]{14,}\s*$/i,
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,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;