component-shipinlv 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/dist/VideoPublish/account-manage/home.js +1 -1
  2. package/dist/VideoPublish/account-manage/list.js +1 -1
  3. package/dist/VideoPublish/account-manage/setting/index.js +2 -0
  4. package/dist/VideoPublish/publish-task-plan/tool.js +65 -11
  5. package/dist/VideoPublish/video-publish-statistic/index.js +18 -3
  6. package/dist/VideoPublish/video-publish-statistic/{list.js → operation/list.js} +5 -5
  7. package/dist/VideoPublish/video-publish-statistic/publish-plan/list.d.ts +7 -0
  8. package/dist/VideoPublish/video-publish-statistic/publish-plan/list.js +228 -0
  9. package/dist/VideoPublish/video-publish-statistic/publish-plan/list.less +105 -0
  10. package/dist/VideoPublish/video-publish-statistic/publish-plan/query.d.ts +8 -0
  11. package/dist/VideoPublish/video-publish-statistic/publish-plan/query.js +57 -0
  12. package/dist/VideoPublish/video-publish-statistic/publish-plan/query.less +3 -0
  13. package/dist/component/isFileExist.d.ts +2 -0
  14. package/dist/component/isFileExist.js +50 -0
  15. package/dist/config/apiUrls.js +1 -1
  16. package/dist/lib/Tool.d.ts +1 -1
  17. package/dist/lib/getPublishExtensionDir.d.ts +2 -0
  18. package/dist/lib/getPublishExtensionDir.js +55 -0
  19. package/dist/lib/openChrome.d.ts +1 -1
  20. package/dist/lib/openChrome.js +210 -113
  21. package/dist/lib/video-api/open-chrome.js +3 -1
  22. package/dist/service/local/VideoPublishTaskController.js +1 -1
  23. package/dist/service/video-api/BaseController.d.ts +1 -0
  24. package/dist/service/video-api/BaseController.js +27 -0
  25. package/dist/service/video-api/FileController.d.ts +1 -0
  26. package/dist/service/video-api/FileController.js +27 -0
  27. package/dist/types/File.d.ts +8 -0
  28. package/dist/types/File.js +0 -0
  29. package/dist/types/VideoPublishVideoAccount.d.ts +1 -0
  30. package/dist/types/VidepApiBase.d.ts +5 -0
  31. package/dist/types/VidepApiBase.js +0 -0
  32. package/package.json +1 -1
  33. /package/dist/VideoPublish/video-publish-statistic/{list.d.ts → operation/list.d.ts} +0 -0
  34. /package/dist/VideoPublish/video-publish-statistic/{list.less → operation/list.less} +0 -0
  35. /package/dist/VideoPublish/video-publish-statistic/{query.d.ts → operation/query.d.ts} +0 -0
  36. /package/dist/VideoPublish/video-publish-statistic/{query.js → operation/query.js} +0 -0
  37. /package/dist/VideoPublish/video-publish-statistic/{query.less → operation/query.less} +0 -0
@@ -110,7 +110,7 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
110
110
  url: 'https://creator.douyin.com/creator-micro/content/manage',
111
111
  proxyInfo: accountDetail.proxyInfo,
112
112
  isOpen: true
113
- }, false);
113
+ }, false, env);
114
114
  Tool.toast('正在打开浏览器, 请稍等...', 12);
115
115
  };
116
116
  var onOpenMenuItems = function onOpenMenuItems(platform) {
@@ -219,7 +219,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
219
219
  url: 'https://creator.douyin.com/',
220
220
  proxyInfo: proxyInfo,
221
221
  isOpen: true // settingConfig.isChromeOpen,
222
- }, true);
222
+ }, true, env);
223
223
 
224
224
  // event.run('publish-video-account-add', {
225
225
  // ...openChromeQuery,
@@ -89,6 +89,8 @@ var AccountManageSettingPage = function AccountManageSettingPage(_ref) {
89
89
  children: /*#__PURE__*/_jsx(Switch, {
90
90
  checkedChildren: "\u663E\u793A\u6D4F\u89C8\u5668",
91
91
  unCheckedChildren: "\u9690\u85CF\u6D4F\u89C8\u5668",
92
+ checked: true,
93
+ disabled: true,
92
94
  onChange: function onChange(isChromeOpen) {
93
95
  formData.isChromeOpen = isChromeOpen;
94
96
  setFormData(_objectSpread({}, formData));
@@ -14,6 +14,7 @@ import param from "../../component/param";
14
14
  import { notification } from "antd";
15
15
  import openChrome from "../../lib/openChrome";
16
16
  import * as LocalVideoPublishTaskController from "../../service/local/VideoPublishTaskController";
17
+ import isFileExist from "../../component/isFileExist";
17
18
  var PublishTaskPlanClass = /*#__PURE__*/function () {
18
19
  function PublishTaskPlanClass(env) {
19
20
  var clientIdentity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
@@ -128,7 +129,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
128
129
  key: "doWork",
129
130
  value: function () {
130
131
  var _doWork = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(taskDetail) {
131
- var item, saveBaseData, result, errMessage, code, errLog;
132
+ var item, saveBaseData, errExistLog, coverExist, errVideoExistLog, videoExist, result, errMessage, code, errLog;
132
133
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
133
134
  while (1) switch (_context2.prev = _context2.next) {
134
135
  case 0:
@@ -154,7 +155,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
154
155
  platformAccountId: taskDetail.platformVideoAccountId
155
156
  };
156
157
  _context2.t0 = item.taskType;
157
- _context2.next = _context2.t0 === "publish-video" ? 12 : 20;
158
+ _context2.next = _context2.t0 === "publish-video" ? 12 : 37;
158
159
  break;
159
160
  case 12:
160
161
  if (item.publishVideo) {
@@ -163,17 +164,69 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
163
164
  }
164
165
  console.warn("item publishVideo is empty!");
165
166
  this.onReport(false, '', "publishVideo 不存在", saveBaseData);
166
- return _context2.abrupt("break", 26);
167
+ return _context2.abrupt("break", 43);
167
168
  case 16:
168
- _context2.next = 18;
169
+ if (!item.publishVideo.publishCoverUrl) {
170
+ _context2.next = 22;
171
+ break;
172
+ }
173
+ errExistLog = {
174
+ platform: taskDetail.platform,
175
+ platformAccountId: taskDetail.platformVideoAccountId,
176
+ code: 'cover-not-exist',
177
+ nickname: taskDetail.nickname,
178
+ message: "",
179
+ status: 'fail',
180
+ taskId: item.taskId,
181
+ eventType: 'task-kind'
182
+ };
183
+ _context2.next = 20;
184
+ return isFileExist(item.publishVideo.publishCoverUrl).catch(function (err) {});
185
+ case 20:
186
+ coverExist = _context2.sent;
187
+ if (!coverExist || !coverExist.isExist) {
188
+ item.publishVideo.publishCoverUrl = '';
189
+ errExistLog.message = '封面文件 本身已经不存在(可能被清理删除),将采用系统推荐封面';
190
+ this.onLog(errExistLog);
191
+ }
192
+ case 22:
193
+ if (!item.publishVideo.videoUrl) {
194
+ _context2.next = 33;
195
+ break;
196
+ }
197
+ errVideoExistLog = {
198
+ platform: taskDetail.platform,
199
+ platformAccountId: taskDetail.platformVideoAccountId,
200
+ code: 'video-not-exist',
201
+ nickname: taskDetail.nickname,
202
+ message: "",
203
+ status: 'fail',
204
+ taskId: item.taskId,
205
+ eventType: 'task-kind'
206
+ };
207
+ _context2.next = 26;
208
+ return isFileExist(item.publishVideo.videoUrl).catch(function (err) {});
209
+ case 26:
210
+ videoExist = _context2.sent;
211
+ if (!(!videoExist || !videoExist.isExist)) {
212
+ _context2.next = 33;
213
+ break;
214
+ }
215
+ item.publishVideo.publishCoverUrl = '';
216
+ errVideoExistLog.message = '视频文件 本身已经不存在(可能被清理删除),任务失败';
217
+ this.onLog(errVideoExistLog);
218
+ this.onReport(false, '', errVideoExistLog.message, saveBaseData);
219
+ return _context2.abrupt("break", 43);
220
+ case 33:
221
+ _context2.next = 35;
169
222
  return this.onPublishVideo(taskDetail.platform, taskDetail.platformVideoAccountId, taskDetail.nickname, taskDetail.chromeProfileName, taskDetail.taskInfo, taskDetail.proxyInfo).catch(function (err) {
170
223
  console.warn("onPublishVideo err:", err);
171
224
  // this.on Report(false, err?.message, saveBaseData );
172
225
  });
173
- case 18:
226
+ case 35:
174
227
  result = _context2.sent;
175
- return _context2.abrupt("break", 26);
176
- case 20:
228
+ return _context2.abrupt("break", 43);
229
+ case 37:
177
230
  errMessage = '暂不支持 类型:' + item.taskType;
178
231
  console.log(errMessage);
179
232
  code = 'not-support-task-type';
@@ -189,10 +242,10 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
189
242
  };
190
243
  this.onLog(errLog);
191
244
  this.onReport(false, code, errMessage, saveBaseData);
192
- case 26:
193
- _context2.next = 28;
245
+ case 43:
246
+ _context2.next = 45;
194
247
  return this.doWorkWait();
195
- case 28:
248
+ case 45:
196
249
  case "end":
197
250
  return _context2.stop();
198
251
  }
@@ -450,6 +503,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
450
503
  key: "onPublishVideoDo",
451
504
  value: function () {
452
505
  var _onPublishVideoDo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(proxyInfo, query, settingConfig) {
506
+ var _this4 = this;
453
507
  var _this;
454
508
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
455
509
  while (1) switch (_context9.prev = _context9.next) {
@@ -500,7 +554,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
500
554
  chromePath: settingConfig.chromePath,
501
555
  chromeProfileName: query.chromeProfileName,
502
556
  isOpen: query.open
503
- }, false);
557
+ }, false, _this4.env);
504
558
  } else if (lastEventId === 'fail') {
505
559
  // query.onDownFail( data );
506
560
  // this.on Report( false, data, {
@@ -1,11 +1,26 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
1
2
  import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
2
- import VideoPublishStatisticPublishList from "./list";
3
+ import VideoPublishStatisticPublishList from "./publish-plan/list";
3
4
  import { getApiEnv } from "../../lib/getApiUrl";
5
+ import { Tabs } from "antd";
6
+ import React, { useState } from "react";
4
7
  import { jsx as _jsx } from "react/jsx-runtime";
5
8
  var VideoPublishStatisticPublish = function VideoPublishStatisticPublish(_ref) {
6
9
  _objectDestructuringEmpty(_ref);
7
- return /*#__PURE__*/_jsx(VideoPublishStatisticPublishList, {
8
- env: getApiEnv()
10
+ var _useState = useState([{
11
+ key: 'publish-video',
12
+ label: '发布任务',
13
+ children: /*#__PURE__*/_jsx(VideoPublishStatisticPublishList, {
14
+ env: getApiEnv()
15
+ })
16
+ }]),
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ itemsTabs = _useState2[0],
19
+ setItemsTabs = _useState2[1];
20
+ return /*#__PURE__*/_jsx(Tabs, {
21
+ defaultActiveKey: "publish-video",
22
+ items: itemsTabs,
23
+ type: "card"
9
24
  });
10
25
  };
11
26
  export default VideoPublishStatisticPublish;
@@ -3,14 +3,14 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import React, { useState } from "react";
4
4
  import "./list.less";
5
5
  import { useRequest } from "@umijs/hooks";
6
- import * as VideoPublishPublishStatisticController from "../../service/api/VideoPublishStatisticPublishController";
6
+ import * as VideoPublishPublishStatisticController from "../../../service/api/VideoPublishStatisticPublishController";
7
7
  import { Button, Divider, Space, Table, Tag } from "antd";
8
- import VideoPublishVideoAccountBaseInfo from "../video-account/base-info";
9
- import LayoutContent from "../../UI/LayoutContent";
8
+ import VideoPublishVideoAccountBaseInfo from "../../video-account/base-info";
9
+ import LayoutContent from "../../../UI/LayoutContent";
10
10
  import VideoPublishStatisticPublishListQuery from "./query";
11
11
  import dayjs from "dayjs";
12
- import Tool from "../../lib/Tool";
13
- import VideoPublishTaskPlanList from "../task-list/plan/list";
12
+ import Tool from "../../../lib/Tool";
13
+ import VideoPublishTaskPlanList from "../../task-list/plan/list";
14
14
  import { SwapRightOutlined } from "@ant-design/icons";
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./list.less";
3
+ interface Props {
4
+ env?: Global.Env;
5
+ }
6
+ declare const VideoPublishStatisticPublishList: React.FC<Props>;
7
+ export default VideoPublishStatisticPublishList;
@@ -0,0 +1,228 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import React, { useState } from "react";
4
+ import "./list.less";
5
+ import { useRequest } from "@umijs/hooks";
6
+ import * as VideoPublishPublishStatisticController from "../../../service/api/VideoPublishStatisticPublishController";
7
+ import { Button, Divider, Space, Table, Tag } from "antd";
8
+ import VideoPublishVideoAccountBaseInfo from "../../video-account/base-info";
9
+ import LayoutContent from "../../../UI/LayoutContent";
10
+ import VideoPublishStatisticPublishListQuery from "./query";
11
+ import dayjs from "dayjs";
12
+ import Tool from "../../../lib/Tool";
13
+ import VideoPublishTaskPlanList from "../../task-list/plan/list";
14
+ import { SwapRightOutlined } from "@ant-design/icons";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
18
+ var VideoPublishStatisticPublishList = function VideoPublishStatisticPublishList(_ref) {
19
+ var env = _ref.env;
20
+ var _useState = useState([]),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ listData = _useState2[0],
23
+ setListData = _useState2[1];
24
+ var _useState3 = useState({
25
+ current: 1,
26
+ pageSize: 100,
27
+ total: 0,
28
+ simple: true,
29
+ showSizeChanger: false,
30
+ showQuickJumper: false
31
+ }),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ pagination = _useState4[0],
34
+ setPagination = _useState4[1];
35
+ var _useState5 = useState({
36
+ startTime: Date.now(),
37
+ endTime: Date.now()
38
+ // taskStatus: '',
39
+ // keyword: '',
40
+ }),
41
+ _useState6 = _slicedToArray(_useState5, 2),
42
+ query = _useState6[0],
43
+ setQuery = _useState6[1];
44
+ var columns = [{
45
+ title: '序号',
46
+ dataIndex: '-',
47
+ key: '-',
48
+ render: function render(_, _1) {
49
+ var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
50
+ return index + 1;
51
+ }
52
+ }, {
53
+ title: '发布账号',
54
+ dataIndex: 'platform',
55
+ key: 'platform',
56
+ render: function render(platform, record) {
57
+ return /*#__PURE__*/_jsx(VideoPublishVideoAccountBaseInfo, {
58
+ accountInfo: record === null || record === void 0 ? void 0 : record.accountInfo
59
+ });
60
+ }
61
+ }, {
62
+ title: '粉丝数',
63
+ dataIndex: 'followerCount',
64
+ key: 'followerCount',
65
+ render: function render(_, record) {
66
+ return record === null || record === void 0 ? void 0 : record.accountInfo.followerCount;
67
+ }
68
+ }, {
69
+ title: /*#__PURE__*/_jsx("div", {
70
+ className: "status-amount ",
71
+ children: /*#__PURE__*/_jsxs("span", {
72
+ className: "finish",
73
+ children: ["\u6210\u529F ", /*#__PURE__*/_jsx("small", {
74
+ children: " / \u6761"
75
+ })]
76
+ })
77
+ }),
78
+ dataIndex: 'finishAmount',
79
+ key: 'finishAmount',
80
+ render: function render(finishAmount, record) {
81
+ return /*#__PURE__*/_jsx("div", {
82
+ className: "status-amount in-td",
83
+ children: /*#__PURE__*/_jsx(Space, {
84
+ children: /*#__PURE__*/_jsx("span", {
85
+ className: "finish amount-".concat(finishAmount),
86
+ children: finishAmount
87
+ })
88
+ })
89
+ });
90
+ }
91
+ }, {
92
+ title: /*#__PURE__*/_jsx("div", {
93
+ className: "status-amount ",
94
+ children: /*#__PURE__*/_jsxs("span", {
95
+ className: "fail",
96
+ children: ["\u5931\u8D25 ", /*#__PURE__*/_jsx("small", {
97
+ children: " / \u6761"
98
+ })]
99
+ })
100
+ }),
101
+ dataIndex: 'failAmount',
102
+ key: 'failAmount',
103
+ render: function render(failAmount) {
104
+ return /*#__PURE__*/_jsx("div", {
105
+ className: "status-amount in-td",
106
+ children: /*#__PURE__*/_jsx("span", {
107
+ className: "fail amount-".concat(failAmount),
108
+ children: failAmount
109
+ })
110
+ });
111
+ }
112
+ }, {
113
+ title: /*#__PURE__*/_jsx("div", {
114
+ className: "status-amount ",
115
+ children: /*#__PURE__*/_jsxs("span", {
116
+ className: "progress",
117
+ children: ["\u6267\u884C\u4E2D ", /*#__PURE__*/_jsx("small", {
118
+ children: " / \u6761"
119
+ })]
120
+ })
121
+ }),
122
+ dataIndex: 'progressAmount',
123
+ key: 'progressAmount',
124
+ render: function render(progressAmount, record) {
125
+ return /*#__PURE__*/_jsx("div", {
126
+ className: "status-amount in-td",
127
+ children: /*#__PURE__*/_jsx("span", {
128
+ className: "progress amount-".concat(progressAmount),
129
+ children: progressAmount
130
+ })
131
+ });
132
+ }
133
+ }, {
134
+ title: '操作',
135
+ dataIndex: '-',
136
+ key: '-',
137
+ render: function render(_, record) {
138
+ return /*#__PURE__*/_jsx("div", {
139
+ className: "operate",
140
+ children: /*#__PURE__*/_jsx(Space, {
141
+ children: /*#__PURE__*/_jsx(Button, {
142
+ type: "link",
143
+ ghost: true,
144
+ size: "small",
145
+ onClick: function onClick() {
146
+ return onAccountPublishPlanList((record === null || record === void 0 ? void 0 : record.accountInfo.id) || 0, record === null || record === void 0 ? void 0 : record.accountInfo.nickname);
147
+ },
148
+ children: "\u53D1\u5E03\u8BE6\u60C5"
149
+ })
150
+ })
151
+ });
152
+ }
153
+ }];
154
+ var _onQuery = function onQuery(query) {
155
+ setQuery(_objectSpread({}, query));
156
+ runTaskList(query, 1);
157
+ };
158
+ var _useRequest = useRequest(function () {
159
+ var postQuery = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : query;
160
+ var current = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : pagination.current;
161
+ return VideoPublishPublishStatisticController.list(_objectSpread(_objectSpread({}, postQuery), {}, {
162
+ startTime: postQuery.startTime > 100000 ? Math.floor(dayjs(postQuery.startTime).startOf('date').valueOf() * 0.001) || 0 : 0,
163
+ endTime: postQuery.endTime > 100000 ? Math.floor(dayjs(postQuery.endTime).endOf('date').valueOf() * 0.001) || 0 : 0,
164
+ current: current,
165
+ pageSize: pagination.pageSize
166
+ }), {
167
+ env: env
168
+ });
169
+ }, {
170
+ onSuccess: function onSuccess(result) {
171
+ setListData(result.list);
172
+ setPagination(result.pagination);
173
+ }
174
+ }),
175
+ runTaskList = _useRequest.run,
176
+ loadingTaskList = _useRequest.loading,
177
+ errorTaskList = _useRequest.error;
178
+ var onAccountPublishPlanList = function onAccountPublishPlanList(accountId) {
179
+ var nickname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
180
+ Tool.drawer({
181
+ title: /*#__PURE__*/_jsxs(_Fragment, {
182
+ children: ["\u53D1\u5E03\u4EFB\u52A1\u8BA1\u5212\uFF1A", /*#__PURE__*/_jsx(Tag, {
183
+ color: "blue",
184
+ children: nickname
185
+ }), /*#__PURE__*/_jsx(Divider, {
186
+ type: "vertical"
187
+ }), query.startTime > 0 && /*#__PURE__*/_jsxs(_Fragment, {
188
+ children: [dayjs(query.startTime).format('YYYY-MM-DD'), " ", /*#__PURE__*/_jsx(SwapRightOutlined, {}), " ", dayjs(query.endTime).format('YYYY-MM-DD')]
189
+ })]
190
+ }),
191
+ content: /*#__PURE__*/_jsx(VideoPublishTaskPlanList, {
192
+ env: env,
193
+ publishTaskId: 0,
194
+ accountId: accountId,
195
+ startTime: query.startTime,
196
+ endTime: query.endTime
197
+ }),
198
+ width: 1200
199
+ });
200
+ };
201
+ return /*#__PURE__*/_jsx(LayoutContent, {
202
+ loading: loadingTaskList,
203
+ error: errorTaskList,
204
+ onReload: runTaskList,
205
+ title: "\u53D1\u5E03\u7EDF\u8BA1",
206
+ className: "video-publish-statistic-list",
207
+ extInfo: /*#__PURE__*/_jsx(VideoPublishStatisticPublishListQuery, {
208
+ defaultQuery: query,
209
+ onQuery: function onQuery(query) {
210
+ return _onQuery(query);
211
+ }
212
+ }),
213
+ children: /*#__PURE__*/_jsx(Table, {
214
+ size: "small",
215
+ bordered: true,
216
+ rowKey: function rowKey(record) {
217
+ return "".concat(record.accountInfo.id);
218
+ }
219
+ // rowClassName={ ( record ) => `row-${ record.status }` }
220
+ ,
221
+ loading: false,
222
+ columns: columns,
223
+ dataSource: listData,
224
+ pagination: false
225
+ })
226
+ });
227
+ };
228
+ export default VideoPublishStatisticPublishList;
@@ -0,0 +1,105 @@
1
+ .video-publish-statistic-list{
2
+
3
+ .article{
4
+ position: relative;
5
+ display: flex;
6
+ flex-direction: row;
7
+ cursor: pointer;
8
+ &.valid{
9
+ .isLoginValid{
10
+ background-color: #00bc00;
11
+ }
12
+ .shopName{
13
+ color: #005a00;
14
+ }
15
+ }
16
+ &.invalid{
17
+ background-color: #e1e1e1;
18
+ .isLoginValid{
19
+ background-color: red;
20
+ }
21
+ .shopName{
22
+ color: #999;
23
+ font-weight: 300;
24
+ }
25
+ .avatarUrl{
26
+ opacity: 0.5;
27
+ filter: grayscale(100%);
28
+ }
29
+ }
30
+ .avatar{
31
+ position: relative;
32
+ width: 40px;
33
+ //box-shadow: 0 0 5px #EEE;
34
+ .avatarUrl{
35
+ border-radius: 100px;
36
+ box-shadow: 0 0 5px #EEE;
37
+ }
38
+ .isLoginValid{
39
+ position: absolute;
40
+ left: 35px;
41
+ top: 35px;
42
+ width: 8px;
43
+ height: 8px;
44
+ border-radius: 100px;
45
+ }
46
+ }
47
+ .shopName{
48
+ max-width: 150px;
49
+ color: #666;
50
+ display: inline-block;
51
+ text-overflow: ellipsis;
52
+ //line-height: 30px;
53
+ font-size: 12px;
54
+ padding: 1px 0 0 12px;
55
+ line-height: 1.1em;
56
+ word-break: keep-all;
57
+ white-space: nowrap;
58
+ overflow: hidden;
59
+ }
60
+ .nicknameRemark{
61
+ max-width: 150px;
62
+ color: #666;
63
+ text-overflow: ellipsis;
64
+ overflow: hidden;
65
+ //background-color: #F6F6F6;
66
+ padding: 2px 0 1px;
67
+ font-weight: 300;
68
+ }
69
+ .uniqueId{
70
+ padding: 1px 0 0;
71
+ font-size: 12px;
72
+ opacity: 0.6;
73
+ }
74
+ }
75
+
76
+ .status-amount{
77
+ &.in-td{
78
+ font-size: 32px;
79
+ line-height: 1em;
80
+ }
81
+ .amount-0{
82
+ font-weight: 300;
83
+ color: #CCC !important;
84
+ }
85
+ small{
86
+ color: #999;
87
+ font-weight: 300;
88
+ }
89
+ .finish{
90
+ color: green;
91
+ }
92
+ .fail{
93
+ color: #C00;
94
+ }
95
+ .progress{
96
+ color: blue;
97
+ }
98
+ }
99
+
100
+ .row-repeal{
101
+ //opacity: 0.5;
102
+ -webkit-filter: grayscale(100%);
103
+ filter: grayscale(100%);
104
+ }
105
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './query.less';
3
+ interface Props {
4
+ defaultQuery: VideoPublishStatisticPublish.ListQuery;
5
+ onQuery: (query: VideoPublishStatisticPublish.ListQuery) => void;
6
+ }
7
+ declare const VideoPublishStatisticPublishListQuery: React.FC<Props>;
8
+ export default VideoPublishStatisticPublishListQuery;
@@ -0,0 +1,57 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import React, { useState } from 'react';
4
+ import { Button, DatePicker, Form, Space } from "antd";
5
+ import "./query.less";
6
+ import dayjs from "dayjs";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ var VideoPublishStatisticPublishListQuery = function VideoPublishStatisticPublishListQuery(_ref) {
10
+ var defaultQuery = _ref.defaultQuery,
11
+ _ref$onQuery = _ref.onQuery,
12
+ onQuery = _ref$onQuery === void 0 ? function () {} : _ref$onQuery;
13
+ var _Form$useForm = Form.useForm(),
14
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
15
+ form = _Form$useForm2[0];
16
+ var _useState = useState(_objectSpread({}, defaultQuery)),
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ query = _useState2[0],
19
+ setQuery = _useState2[1];
20
+ var todayEnd = dayjs(dayjs(Date.now()).format('YYYY-MM-DD 23:59:59')).valueOf();
21
+ var onTime = function onTime(startTime, endTime) {
22
+ query.startTime = startTime;
23
+ query.endTime = endTime;
24
+ setQuery(_objectSpread({}, query));
25
+ };
26
+ var onFinish = function onFinish() {
27
+ var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28
+ onQuery(_objectSpread(_objectSpread({}, query), values));
29
+ };
30
+ return /*#__PURE__*/_jsx("div", {
31
+ className: "videoPublishTaskPlanListQuery",
32
+ children: /*#__PURE__*/_jsx(Form, {
33
+ form: form,
34
+ initialValues: _objectSpread({}, query),
35
+ onFinish: onFinish,
36
+ children: /*#__PURE__*/_jsxs(Space, {
37
+ children: [/*#__PURE__*/_jsx(Form.Item, {
38
+ children: /*#__PURE__*/_jsx(DatePicker.RangePicker, {
39
+ defaultValue: query.startTime > 0 ? [query.startTime <= 0 ? null : dayjs(query.startTime), query.endTime <= 0 ? null : dayjs(query.endTime)] : undefined,
40
+ disabledDate: function disabledDate(currentDate) {
41
+ return currentDate.valueOf() > todayEnd;
42
+ },
43
+ onChange: function onChange(dates, dateStrings) {
44
+ var _dates$, _dates$2;
45
+ onTime((dates === null || dates === void 0 || (_dates$ = dates[0]) === null || _dates$ === void 0 ? void 0 : _dates$.valueOf()) || 0, (dates === null || dates === void 0 || (_dates$2 = dates[1]) === null || _dates$2 === void 0 ? void 0 : _dates$2.valueOf()) || 0);
46
+ }
47
+ })
48
+ }), /*#__PURE__*/_jsx(Button, {
49
+ type: "primary",
50
+ htmlType: "submit",
51
+ children: "\u641C\u7D22"
52
+ })]
53
+ })
54
+ })
55
+ });
56
+ };
57
+ export default VideoPublishStatisticPublishListQuery;
@@ -0,0 +1,3 @@
1
+ .videoPublishTaskPlanListQuery{
2
+
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const isFileExist: (filePath: string) => Promise<File.IsExistResult>;
2
+ export default isFileExist;
@@ -0,0 +1,50 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import * as FileController from "../service/video-api/FileController";
4
+ var isFileExist = /*#__PURE__*/function () {
5
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(filePath) {
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 result;
12
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13
+ while (1) switch (_context.prev = _context.next) {
14
+ case 0:
15
+ _context.next = 2;
16
+ return FileController.isExist({
17
+ filePath: filePath
18
+ }).catch(function (err) {
19
+ reject(err);
20
+ });
21
+ case 2:
22
+ result = _context.sent;
23
+ if (result) {
24
+ _context.next = 5;
25
+ break;
26
+ }
27
+ return _context.abrupt("return");
28
+ case 5:
29
+ resolve(result);
30
+ case 6:
31
+ case "end":
32
+ return _context.stop();
33
+ }
34
+ }, _callee);
35
+ }));
36
+ return function (_x2, _x3) {
37
+ return _ref2.apply(this, arguments);
38
+ };
39
+ }()));
40
+ case 1:
41
+ case "end":
42
+ return _context2.stop();
43
+ }
44
+ }, _callee2);
45
+ }));
46
+ return function isFileExist(_x) {
47
+ return _ref.apply(this, arguments);
48
+ };
49
+ }();
50
+ export default isFileExist;
@@ -1,5 +1,5 @@
1
1
  // 业务服务器 api
2
- export var currentEnv = 'prod';
2
+ export var currentEnv = 'local';
3
3
  var ApiUrls = {
4
4
  local: {
5
5
  api: 'http://localhost:9999/',
@@ -161,7 +161,7 @@ declare const Tool: {
161
161
  OsPathSeparator(): string;
162
162
  getTitleByPath(path: string): string;
163
163
  h5Pay(query: Pay.H5PayQuery): void;
164
- notification(type: "success" | "info" | "error" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
164
+ notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
165
165
  notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
166
166
  notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
167
167
  notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
@@ -0,0 +1,2 @@
1
+ declare const getPublishExtensionDir: (env: Global.Env | '' | undefined) => Promise<string>;
2
+ export default getPublishExtensionDir;
@@ -0,0 +1,55 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import { getLocalVideoServerDir } from "../service/video-api/BaseController";
4
+ var getPublishExtensionDir = /*#__PURE__*/function () {
5
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(env) {
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 result, dir;
12
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13
+ while (1) switch (_context.prev = _context.next) {
14
+ case 0:
15
+ _context.next = 2;
16
+ return getLocalVideoServerDir().catch(function (err) {
17
+ reject(err);
18
+ });
19
+ case 2:
20
+ result = _context.sent;
21
+ if (result) {
22
+ _context.next = 5;
23
+ break;
24
+ }
25
+ return _context.abrupt("return");
26
+ case 5:
27
+ if (!(env === 'local')) {
28
+ _context.next = 7;
29
+ break;
30
+ }
31
+ return _context.abrupt("return", resolve('/Volumes/Data/Web/shipinlv/chrome-shipinlv-video-publish/public'));
32
+ case 7:
33
+ dir = result.dirPath + '/../../../chrome-publish-plugin';
34
+ resolve(dir);
35
+ case 9:
36
+ case "end":
37
+ return _context.stop();
38
+ }
39
+ }, _callee);
40
+ }));
41
+ return function (_x2, _x3) {
42
+ return _ref2.apply(this, arguments);
43
+ };
44
+ }()));
45
+ case 1:
46
+ case "end":
47
+ return _context2.stop();
48
+ }
49
+ }, _callee2);
50
+ }));
51
+ return function getPublishExtensionDir(_x) {
52
+ return _ref.apply(this, arguments);
53
+ };
54
+ }();
55
+ export default getPublishExtensionDir;
@@ -1,2 +1,2 @@
1
- declare const openChrome: (query: ChromeOperate.PropsQuery, isNew: boolean) => Promise<void>;
1
+ declare const openChrome: (query: ChromeOperate.PropsQuery, isNew: boolean, env: Global.Env | '' | undefined) => Promise<unknown>;
2
2
  export default openChrome;
@@ -1,4 +1,5 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
4
  import AccountManageSettingConfig from "./accountManageSettingConfig";
4
5
  import param from "../component/param";
@@ -8,139 +9,235 @@ import userAgent from "./user-agent";
8
9
  import VideoApiOpenChrome from "./video-api/open-chrome";
9
10
  import sleep from "./sleep";
10
11
  import VideoApiQuitChrome from "./video-api/quit-chrome";
12
+ import event from "./event";
13
+ import * as VideoPublishCrawlerTaskController from "../service/api/VideoPublishCrawlerTaskController";
14
+ import * as LocalVideoPublishTaskController from "../service/local/VideoPublishTaskController";
15
+ import getPublishExtensionDir from "./getPublishExtensionDir";
16
+
11
17
  // @isNew: 只有 新建账户,才要 isNew
12
18
  var openChrome = /*#__PURE__*/function () {
13
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, isNew) {
14
- var settingConfig, data, cmdResult;
15
- return _regeneratorRuntime().wrap(function _callee$(_context) {
16
- while (1) switch (_context.prev = _context.next) {
19
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query, isNew, env) {
20
+ var settingConfig;
21
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
22
+ while (1) switch (_context3.prev = _context3.next) {
17
23
  case 0:
18
24
  settingConfig = AccountManageSettingConfig();
19
25
  if (!query.chromePath) {
20
26
  query.chromePath = settingConfig.chromePath;
21
27
  }
22
28
  if (query.chromePath) {
23
- _context.next = 5;
29
+ _context3.next = 5;
24
30
  break;
25
31
  }
26
32
  notification.notificationError('没找到 Google 浏览器', '请设置 谷歌浏览器地址,或者重新安装 https://google.cn/chrome/');
27
- return _context.abrupt("return");
33
+ return _context3.abrupt("return");
28
34
  case 5:
29
- data = getOpenQuery(query, isNew, settingConfig);
30
- if (!query.chromeProfileName) {
31
- _context.next = 11;
32
- break;
33
- }
34
- _context.next = 9;
35
- return VideoApiQuitChrome({
36
- platform: query.platform,
37
- platformVideoAccountId: query.platformAccountId,
38
- chromeProfileName: query.chromeProfileName
39
- }).catch(function (err) {
40
- console.warn('关闭 chrome 失败', query);
41
- });
42
- case 9:
43
- _context.next = 11;
44
- return sleep(2e3);
45
- case 11:
46
- _context.next = 13;
47
- return VideoApiOpenChrome({
48
- commandList: data.commandList
49
- }).catch(function (err) {
50
- // todo 上报
51
- console.log('open chrome err:', err);
52
- // VideoPublishCrawlerTaskController.report({
53
- // success: false,
54
- // code: 'open-chrome-fail',
55
- // message: err?.message,
56
- //
57
- // taskType: '',
58
- // taskId: query.taskId,
59
- // platform: query.platform,
60
- // platformAccountId: query.platformAccountId,
61
- // },{
62
- // // env,
63
- // });
64
- });
65
- case 13:
66
- cmdResult = _context.sent;
67
- console.log("cmd:", query);
68
- if (!cmdResult) {
69
- // await sleep( 6e3 );
70
- // VideoApiQuitChrome({
71
- // platform: query.platform,
72
- // platformVideoAccountId: query.platformAccountId,
73
- // chromeProfileName: query.chromeProfileName,
74
- // });
75
- }
76
- case 16:
35
+ return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
36
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
37
+ var data, cmdResult;
38
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
39
+ while (1) switch (_context2.prev = _context2.next) {
40
+ case 0:
41
+ _context2.next = 2;
42
+ return getOpenQuery(query, isNew, settingConfig, env).catch(function (err) {
43
+ reject(err);
44
+ });
45
+ case 2:
46
+ data = _context2.sent;
47
+ if (data) {
48
+ _context2.next = 5;
49
+ break;
50
+ }
51
+ return _context2.abrupt("return");
52
+ case 5:
53
+ if (!query.chromeProfileName) {
54
+ _context2.next = 10;
55
+ break;
56
+ }
57
+ _context2.next = 8;
58
+ return VideoApiQuitChrome({
59
+ platform: query.platform,
60
+ platformVideoAccountId: query.platformAccountId,
61
+ chromeProfileName: query.chromeProfileName
62
+ }).catch(function (err) {
63
+ console.warn('关闭 chrome 失败', query);
64
+ });
65
+ case 8:
66
+ _context2.next = 10;
67
+ return sleep(2e3);
68
+ case 10:
69
+ _context2.next = 12;
70
+ return VideoApiOpenChrome({
71
+ commandList: data.commandList
72
+ }).catch( /*#__PURE__*/function () {
73
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err) {
74
+ var sendData;
75
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
76
+ while (1) switch (_context.prev = _context.next) {
77
+ case 0:
78
+ console.log('open chrome err:', err);
79
+ notification.notificationError('打开 Google 浏览器 失败', err === null || err === void 0 ? void 0 : err.message);
80
+ sendData = {
81
+ success: false,
82
+ platform: query.platform,
83
+ platformAccountId: query.platformAccountId,
84
+ code: 'open-chrome-fail',
85
+ message: (err === null || err === void 0 ? void 0 : err.message) || JSON.stringify(err),
86
+ taskId: query.taskId,
87
+ taskType: 'publish-video'
88
+ };
89
+ event.run('publish-video-log-publish-video', sendData);
90
+
91
+ // 发消息 , 不管结果,无论失败
92
+ LocalVideoPublishTaskController.sendMessageToPort(_objectSpread({}, sendData));
93
+ VideoPublishCrawlerTaskController.report(_objectSpread({}, sendData), {
94
+ // env: this.env,
95
+ });
96
+ _context.next = 8;
97
+ return sleep(2e3);
98
+ case 8:
99
+ reject(err);
100
+
101
+ // VideoPublishCrawlerTaskController.report({
102
+ // success: false,
103
+ // code: 'open-chrome-fail',
104
+ // message: err?.message,
105
+ //
106
+ // taskType: '',
107
+ // taskId: query.taskId,
108
+ // platform: query.platform,
109
+ // platformAccountId: query.platformAccountId,
110
+ // },{
111
+ // // env,
112
+ // });
113
+ case 9:
114
+ case "end":
115
+ return _context.stop();
116
+ }
117
+ }, _callee);
118
+ }));
119
+ return function (_x6) {
120
+ return _ref3.apply(this, arguments);
121
+ };
122
+ }());
123
+ case 12:
124
+ cmdResult = _context2.sent;
125
+ console.log("cmd:", query);
126
+ if (cmdResult) {
127
+ _context2.next = 16;
128
+ break;
129
+ }
130
+ return _context2.abrupt("return");
131
+ case 16:
132
+ resolve(true);
133
+ case 17:
134
+ case "end":
135
+ return _context2.stop();
136
+ }
137
+ }, _callee2);
138
+ }));
139
+ return function (_x4, _x5) {
140
+ return _ref2.apply(this, arguments);
141
+ };
142
+ }()));
143
+ case 6:
77
144
  case "end":
78
- return _context.stop();
145
+ return _context3.stop();
79
146
  }
80
- }, _callee);
147
+ }, _callee3);
81
148
  }));
82
- return function openChrome(_x, _x2) {
149
+ return function openChrome(_x, _x2, _x3) {
83
150
  return _ref.apply(this, arguments);
84
151
  };
85
152
  }();
86
- var getOpenQuery = function getOpenQuery(query, isNew, settingConfig) {
87
- var cmdList = [];
88
- var url = query.url;
89
- var openUrl = url + ((url === null || url === void 0 ? void 0 : url.indexOf('?')) === -1 ? '?' : '&') + param({
90
- _shipinlvFrom: 'auto',
91
- _action: query.action || '',
92
- _platformAccountId: query.platformAccountId,
93
- _nickname: query.nickname || '',
94
- _chromeProfileName: query.chromeProfileName || ''
95
- });
96
- var chromeProfileDir = settingConfig.chromeUserDataDir + '/' + query.chromeProfileName;
97
- switch (Tool.getOsName()) {
98
- case "windows":
99
- // 艹,屎一样的 windows cmd
100
- // powershell -NoProfile -Command "Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe'"
101
- // cmdList.push( "cmd", "/c", "start" );
102
- // cmdList.push( "powershell", "-NoProfile", "-Command", "\"Start-Process", "-FilePath" );
103
- if (query.chromePath) {
104
- cmdList.push("".concat(query.chromePath));
105
- } else {
106
- cmdList.push("chrome");
107
- }
108
- if (!query.isOpen) {
109
- cmdList.push("--headless=old");
110
-
111
- // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
112
- cmdList.push("--disable-gpu");
113
- }
114
- break;
115
- case "darwin":
116
- cmdList = ["open"];
117
- if (isNew) {
118
- cmdList.push("-n");
119
- }
120
- cmdList.push("-a", "".concat(query.chromePath || 'Google Chrome'), "--args");
121
- if (!query.isOpen) {
122
- cmdList.push("--headless");
153
+ var getOpenQuery = /*#__PURE__*/function () {
154
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query, isNew, settingConfig, env) {
155
+ var cmdList, url, openUrl, chromeProfileDir, publishExtensionDir;
156
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
157
+ while (1) switch (_context4.prev = _context4.next) {
158
+ case 0:
159
+ cmdList = [];
160
+ url = query.url; // todo
161
+ query.isOpen = true;
162
+ openUrl = url + ((url === null || url === void 0 ? void 0 : url.indexOf('?')) === -1 ? '?' : '&') + param({
163
+ _shipinlvFrom: 'auto',
164
+ _action: query.action || '',
165
+ _platformAccountId: query.platformAccountId,
166
+ _nickname: query.nickname || '',
167
+ _chromeProfileName: query.chromeProfileName || ''
168
+ });
169
+ chromeProfileDir = settingConfig.chromeUserDataDir + '/' + query.chromeProfileName;
170
+ _context4.t0 = Tool.getOsName();
171
+ _context4.next = _context4.t0 === "windows" ? 8 : _context4.t0 === "darwin" ? 11 : 16;
172
+ break;
173
+ case 8:
174
+ // 艹,屎一样的 windows cmd
175
+ // powershell -NoProfile -Command "Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe'"
176
+ // cmdList.push( "cmd", "/c", "start" );
177
+ // cmdList.push( "powershell", "-NoProfile", "-Command", "\"Start-Process", "-FilePath" );
178
+ if (query.chromePath) {
179
+ cmdList.push("".concat(query.chromePath));
180
+ } else {
181
+ cmdList.push("chrome");
182
+ }
183
+ if (!query.isOpen) {
184
+ cmdList.push("--headless=old");
123
185
 
124
- // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
125
- cmdList.push("--disable-gpu");
126
- }
127
- break;
128
- default:
129
- notification.notificationError('不支持的系统', '发布不支持此系统');
130
- }
186
+ // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
187
+ cmdList.push("--disable-gpu");
188
+ }
189
+ return _context4.abrupt("break", 17);
190
+ case 11:
191
+ cmdList = ["open"];
192
+ if (isNew) {
193
+ cmdList.push("-n");
194
+ }
195
+ cmdList.push("-a", "".concat(query.chromePath || 'Google Chrome'), "--args");
196
+ if (!query.isOpen) {
197
+ cmdList.push("--headless");
131
198
 
132
- // 尺寸
133
- cmdList.push("--window-size=".concat(window.screen.width, ",").concat(window.screen.height));
134
- cmdList.push("--user-data-dir=".concat(chromeProfileDir));
135
- cmdList.push("--user-agent=".concat(userAgent()));
199
+ // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
200
+ cmdList.push("--disable-gpu");
201
+ }
202
+ return _context4.abrupt("break", 17);
203
+ case 16:
204
+ notification.notificationError('不支持的系统', '发布不支持此系统');
205
+ case 17:
206
+ // 尺寸
207
+ cmdList.push("--window-position=".concat(-window.screen.width + 20, ",10"));
208
+ cmdList.push("--window-size=".concat(window.screen.width, ",").concat(window.screen.height - 100));
209
+ cmdList.push("--user-data-dir=".concat(chromeProfileDir));
210
+ cmdList.push("--user-agent=".concat(userAgent()));
136
211
 
137
- // 不要检查
138
- cmdList.push('--no-first-run', '--no-default-browser-check', '--disable-default-apps');
139
- cmdList.push("".concat(openUrl));
140
- console.log('profileName:', cmdList, chromeProfileDir);
141
- return {
142
- commandList: cmdList,
143
- chromeProfileDir: chromeProfileDir
212
+ // 不要检查
213
+ cmdList.push('--no-first-run', '--no-default-browser-check', '--disable-default-apps');
214
+ _context4.next = 24;
215
+ return getPublishExtensionDir(env).catch(function (err) {
216
+ notification.notificationError('获取插件地址失败', err.message);
217
+ });
218
+ case 24:
219
+ publishExtensionDir = _context4.sent;
220
+ if (publishExtensionDir) {
221
+ _context4.next = 27;
222
+ break;
223
+ }
224
+ return _context4.abrupt("return", Promise.reject(new Error('获取插件地址失败')));
225
+ case 27:
226
+ cmdList.push("--load-extension=".concat(publishExtensionDir));
227
+ cmdList.push("".concat(openUrl));
228
+ console.log('profileName:', cmdList, chromeProfileDir);
229
+ return _context4.abrupt("return", {
230
+ commandList: cmdList,
231
+ chromeProfileDir: chromeProfileDir
232
+ });
233
+ case 31:
234
+ case "end":
235
+ return _context4.stop();
236
+ }
237
+ }, _callee4);
238
+ }));
239
+ return function getOpenQuery(_x7, _x8, _x9, _x10) {
240
+ return _ref4.apply(this, arguments);
144
241
  };
145
- };
242
+ }();
146
243
  export default openChrome;
@@ -13,7 +13,9 @@ var VideoApiOpenChrome = /*#__PURE__*/function () {
13
13
  while (1) switch (_context.prev = _context.next) {
14
14
  case 0:
15
15
  _context.next = 2;
16
- return VideoApiOpenChromeController.openChrome(query).catch(function (err) {
16
+ return VideoApiOpenChromeController.openChrome(query, {
17
+ timeout: 60e3
18
+ }).catch(function (err) {
17
19
  // if( err?.name === "shipinlv-client-not-run" ){
18
20
  // return reject( err );
19
21
  // }
@@ -19,7 +19,7 @@ function _sendMessageToPort() {
19
19
  'Content-Type': 'application/json'
20
20
  },
21
21
  data: _objectSpread({}, body),
22
- timeout: 6e3,
22
+ timeout: 10e3,
23
23
  silent: true
24
24
  }, options || {})));
25
25
  case 2:
@@ -0,0 +1 @@
1
+ export declare function getLocalVideoServerDir(body?: {}, options?: ServicesApi.RequestOptions): Promise<VideoApiBase.LocalVideoServerDir>;
@@ -0,0 +1,27 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import request from "../../lib/request";
5
+ export function getLocalVideoServerDir(_x, _x2) {
6
+ return _getLocalVideoServerDir.apply(this, arguments);
7
+ }
8
+ function _getLocalVideoServerDir() {
9
+ _getLocalVideoServerDir = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
10
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11
+ while (1) switch (_context.prev = _context.next) {
12
+ case 0:
13
+ return _context.abrupt("return", request("_video-api/base/getLocalVideoServerDir", _objectSpread({
14
+ method: 'POST',
15
+ headers: {
16
+ 'Content-Type': 'application/json'
17
+ },
18
+ data: body
19
+ }, options || {})));
20
+ case 1:
21
+ case "end":
22
+ return _context.stop();
23
+ }
24
+ }, _callee);
25
+ }));
26
+ return _getLocalVideoServerDir.apply(this, arguments);
27
+ }
@@ -0,0 +1 @@
1
+ export declare function isExist(body: File.IsExistQuery, options?: ServicesApi.RequestOptions): Promise<File.IsExistResult>;
@@ -0,0 +1,27 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import request from "../../lib/request";
5
+ export function isExist(_x, _x2) {
6
+ return _isExist.apply(this, arguments);
7
+ }
8
+ function _isExist() {
9
+ _isExist = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
10
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11
+ while (1) switch (_context.prev = _context.next) {
12
+ case 0:
13
+ return _context.abrupt("return", request("_video-api/file/isExist", _objectSpread({
14
+ method: 'POST',
15
+ headers: {
16
+ 'Content-Type': 'application/json'
17
+ },
18
+ data: body
19
+ }, options || {})));
20
+ case 1:
21
+ case "end":
22
+ return _context.stop();
23
+ }
24
+ }, _callee);
25
+ }));
26
+ return _isExist.apply(this, arguments);
27
+ }
@@ -0,0 +1,8 @@
1
+ declare namespace File {
2
+ interface IsExistQuery {
3
+ filePath: string;
4
+ }
5
+ interface IsExistResult {
6
+ isExist: boolean;
7
+ }
8
+ }
File without changes
@@ -17,6 +17,7 @@ declare namespace VideoPublishVideoAccount {
17
17
  isLoginValid: boolean;
18
18
  "groupId": number;
19
19
  "groupName": string;
20
+ followerCount: number;
20
21
  "uniqueId": string;
21
22
  "accountId": string;
22
23
  "avatar": string;
@@ -0,0 +1,5 @@
1
+ declare namespace VideoApiBase {
2
+ interface LocalVideoServerDir {
3
+ dirPath: string;
4
+ }
5
+ }
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",