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
@@ -7,6 +7,7 @@ import "./folder-select.less";
7
7
  import { Button, Input, Space } from "antd";
8
8
  import { FolderOpenOutlined, FolderOutlined } from "@ant-design/icons";
9
9
  import { folderSelect, folderOpen } from "./..";
10
+ import folderCreate from "../base/folderCreate";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  var FolderSelect = function FolderSelect(_ref) {
@@ -19,6 +20,7 @@ var FolderSelect = function FolderSelect(_ref) {
19
20
  _ref$label = _ref.label,
20
21
  label = _ref$label === void 0 ? '' : _ref$label,
21
22
  disabled = _ref.disabled,
23
+ autoCreateDirName = _ref.autoCreateDirName,
22
24
  _ref$placeholder = _ref.placeholder,
23
25
  placeholder = _ref$placeholder === void 0 ? '请选择文件夹' : _ref$placeholder,
24
26
  _ref$hiddenOpenDir = _ref.hiddenOpenDir,
@@ -42,8 +44,8 @@ var FolderSelect = function FolderSelect(_ref) {
42
44
  setLoadingOpenDir = _useState6[1];
43
45
  var onSelectDir = /*#__PURE__*/function () {
44
46
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
45
- var _fileResul$filePaths;
46
- var beforeSelectResult, fileResul, filePaths, selectFolderPath;
47
+ var _fileResul$filePaths, _autoCreateDirName;
48
+ var beforeSelectResult, fileResul, filePaths, selectFolderPath, isEndNameIndex, targetDir, createResul;
47
49
  return _regeneratorRuntime().wrap(function _callee$(_context) {
48
50
  while (1) switch (_context.prev = _context.next) {
49
51
  case 0:
@@ -69,30 +71,62 @@ var FolderSelect = function FolderSelect(_ref) {
69
71
  });
70
72
  case 10:
71
73
  fileResul = _context.sent;
72
- setTimeout(function () {
73
- setLoadingSelectDir(false);
74
- }, 1e3);
75
74
  if (fileResul) {
76
75
  _context.next = 14;
77
76
  break;
78
77
  }
78
+ setTimeout(function () {
79
+ setLoadingSelectDir(false);
80
+ }, 1e3);
79
81
  return _context.abrupt("return");
80
82
  case 14:
81
83
  filePaths = (fileResul === null || fileResul === void 0 ? void 0 : fileResul.filePaths) || [];
82
84
  if (!(filePaths.length <= 0)) {
83
- _context.next = 17;
85
+ _context.next = 18;
84
86
  break;
85
87
  }
88
+ setTimeout(function () {
89
+ setLoadingSelectDir(false);
90
+ }, 1e3);
86
91
  return _context.abrupt("return");
87
- case 17:
92
+ case 18:
88
93
  selectFolderPath = (fileResul === null || fileResul === void 0 || (_fileResul$filePaths = fileResul.filePaths) === null || _fileResul$filePaths === void 0 ? void 0 : _fileResul$filePaths[0]) || '';
89
94
  console.log("selectFolderPath 2:", selectFolderPath);
90
- if (selectFolderPath) {
91
- Tool.toast('已选择文件夹');
92
- onFinish(selectFolderPath);
93
- onDir(selectFolderPath);
95
+ autoCreateDirName = ((_autoCreateDirName = autoCreateDirName) === null || _autoCreateDirName === void 0 ? void 0 : _autoCreateDirName.replace(/^\//, '')) || '';
96
+ if (!selectFolderPath) {
97
+ _context.next = 33;
98
+ break;
94
99
  }
95
- case 20:
100
+ if (!autoCreateDirName) {
101
+ _context.next = 30;
102
+ break;
103
+ }
104
+ isEndNameIndex = selectFolderPath.length - autoCreateDirName.length; // 如果 要加的名字,等于 路径后面的;就不加了
105
+ if (!(selectFolderPath.lastIndexOf(autoCreateDirName) !== isEndNameIndex)) {
106
+ _context.next = 30;
107
+ break;
108
+ }
109
+ targetDir = selectFolderPath + '/' + autoCreateDirName;
110
+ _context.next = 28;
111
+ return folderCreate(targetDir).catch(function (err) {
112
+ console.log('auto Create DirName err :', err);
113
+ });
114
+ case 28:
115
+ createResul = _context.sent;
116
+ if (createResul) {
117
+ selectFolderPath = targetDir;
118
+ } else {
119
+ // 接受这个错误,忽略
120
+ }
121
+ case 30:
122
+ Tool.toast('已选择文件夹');
123
+ onFinish(selectFolderPath);
124
+ onDir(selectFolderPath);
125
+ case 33:
126
+ setTimeout(function () {
127
+ setLoadingSelectDir(false);
128
+ }, 1e3);
129
+ case 34:
96
130
  case "end":
97
131
  return _context.stop();
98
132
  }
@@ -0,0 +1,5 @@
1
+ interface ParamQuery {
2
+ [name: string]: string | number | boolean;
3
+ }
4
+ declare const param: (query?: ParamQuery) => string;
5
+ export default param;
@@ -0,0 +1,9 @@
1
+ var param = function param() {
2
+ var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3
+ var queryString = [];
4
+ for (var i in query) {
5
+ queryString.push("".concat(i, "=").concat(encodeURIComponent(query[i] || '')));
6
+ }
7
+ return queryString.join('&');
8
+ };
9
+ export default param;
@@ -0,0 +1,11 @@
1
+ declare class SSE {
2
+ apiUrl: string;
3
+ source: EventSource | null;
4
+ onMessage: (lastEventId: string, data: string) => void;
5
+ onOpen: () => void;
6
+ onClose: () => void;
7
+ onError: (err: Error) => void;
8
+ constructor(apiUrl: string, onMessage: (lastEventId: string, data: string) => void, onOpen: () => void, onClose: () => void, onError: (err: Error) => void);
9
+ onInit(): void;
10
+ }
11
+ export default SSE;
@@ -0,0 +1,66 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ var SSE = /*#__PURE__*/function () {
5
+ function SSE(apiUrl, onMessage, onOpen, onClose, onError) {
6
+ _classCallCheck(this, SSE);
7
+ _defineProperty(this, "apiUrl", '');
8
+ _defineProperty(this, "source", null);
9
+ _defineProperty(this, "onMessage", function (lastEventId, data) {});
10
+ _defineProperty(this, "onOpen", function () {});
11
+ _defineProperty(this, "onClose", function () {});
12
+ _defineProperty(this, "onError", function (err) {});
13
+ this.apiUrl = apiUrl;
14
+ this.onMessage = onMessage;
15
+ this.onOpen = onOpen;
16
+ this.onClose = onClose;
17
+ this.onError = onError;
18
+ }
19
+ _createClass(SSE, [{
20
+ key: "onInit",
21
+ value: function onInit() {
22
+ var _this = this;
23
+ // 创建一个新的EventSource
24
+ this.source = new EventSource(this.apiUrl);
25
+
26
+ // this.source.onmessage = ( event ) => {
27
+ // console.log('接收到消息:', event );
28
+ //
29
+ // }
30
+
31
+ // 监听message事件(默认事件名称为message)
32
+ this.source.addEventListener('message', function (event) {
33
+ // event.data包含服务器发送的信息
34
+ // console.log('接收到消息:', event );
35
+ _this.onMessage(event.lastEventId, event.data);
36
+ }, false);
37
+
38
+ // 监听open事件,当连接建立时触发
39
+ this.source.addEventListener('open', function (event) {
40
+ // event.data包含服务器发送的信息
41
+ console.log(' 消息 open :', event);
42
+ _this.onOpen();
43
+ }, false);
44
+ this.source.addEventListener('error', function (event) {
45
+ var _event$target, _this$source;
46
+ // event.data包含服务器发送的信息
47
+ // @ts-ignore
48
+ var readyState = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.readyState;
49
+ if (readyState === EventSource.CLOSED) {
50
+ console.log('连接已关闭');
51
+ _this.onClose();
52
+ }
53
+ if (readyState === EventSource.CONNECTING) {
54
+ console.log('连接已关闭: EventSource.CONNECTING');
55
+ // this.onError( new Error('连接时失败'));
56
+ } else {
57
+ console.error('发生错误或连接关闭', readyState);
58
+ _this.onError(new Error('发生错误或连接关闭'));
59
+ }
60
+ (_this$source = _this.source) === null || _this$source === void 0 || _this$source.close();
61
+ }, false);
62
+ }
63
+ }]);
64
+ return SSE;
65
+ }();
66
+ export default SSE;
@@ -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: "info" | "error" | "success" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
164
+ notification(type: "success" | "info" | "error" | "warning", 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;
package/dist/lib/Tool.js CHANGED
@@ -122,7 +122,7 @@ var Tool = _objectSpread(_objectSpread({
122
122
  }
123
123
  window.__events.forEach(function (item) {
124
124
  // 命中 子集事件
125
- if (item.name === name || "".concat(item.name, ".").indexOf(name) === 0) {
125
+ if (item.name === name || "".concat(item.name, ".").indexOf(name + '.') === 0) {
126
126
  item.fn(data);
127
127
  }
128
128
  });
@@ -155,7 +155,7 @@ var Tool = _objectSpread(_objectSpread({
155
155
  window.__events.forEach(function (item, index) {
156
156
  var isDel;
157
157
  // 匹配到子集事件
158
- if ("".concat(item.name, ".").indexOf(name) > -1) {
158
+ if ("".concat(item.name, ".").indexOf(name + '.') > -1) {
159
159
  isDel = true;
160
160
  } else if (name === item.name) {
161
161
  // 一级,子集的子集
@@ -8,7 +8,9 @@ var AccountManageSettingConfig = function AccountManageSettingConfig(data) {
8
8
  return data;
9
9
  }
10
10
  var chromePath = (_window$getBridge = (_window = window).getBridge) === null || _window$getBridge === void 0 ? void 0 : _window$getBridge.call(_window).getChromiumPath();
11
- console.log('AccountManageSettingConfig get:', chromePath);
11
+
12
+ // console.log('AccountManageSettingConfig get:', chromePath );
13
+
12
14
  var storeData = store.get(AccountManageSettingConfigKey);
13
15
  var outData = _objectSpread(_objectSpread({
14
16
  isChromeOpen: false,
package/dist/lib/event.js CHANGED
@@ -9,7 +9,7 @@ var event = {
9
9
  }
10
10
  window.__events.forEach(function (item) {
11
11
  // 命中 子集事件
12
- if (item.name === name || "".concat(item.name, ".").indexOf(name) === 0) {
12
+ if (item.name === name || "".concat(item.name, ".").indexOf(name + '.') === 0) {
13
13
  item.fn(data);
14
14
  }
15
15
  });
@@ -42,7 +42,7 @@ var event = {
42
42
  window.__events.forEach(function (item, index) {
43
43
  var isDel;
44
44
  // 匹配到子集事件
45
- if ("".concat(item.name, ".").indexOf(name) > -1) {
45
+ if ("".concat(item.name, ".").indexOf(name + '.') > -1) {
46
46
  isDel = true;
47
47
  } else if (name === item.name) {
48
48
  // 一级,子集的子集
@@ -1,4 +1,5 @@
1
1
  export declare const getMainPort: () => number;
2
+ export declare const getLocalServerPort: () => number;
2
3
  declare const getApiUrl: (apiName?: string, apiEnv?: Global.Env | '') => string;
3
4
  export declare const getApiEnv: (apiEnv?: Global.Env | '') => Global.Env;
4
5
  export declare const getEnv: (env?: Global.Env | '') => Global.Env;
@@ -10,6 +10,9 @@ var envData = function envData() {
10
10
  export var getMainPort = function getMainPort() {
11
11
  return window.__ShipinlvMainPort || 61800;
12
12
  };
13
+ export var getLocalServerPort = function getLocalServerPort() {
14
+ return window.__ShipinlvLocalServerPort || 61806;
15
+ };
13
16
  var getApiUrl = function getApiUrl() {
14
17
  var _domain;
15
18
  var apiName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -19,11 +22,16 @@ var getApiUrl = function getApiUrl() {
19
22
  return apiName;
20
23
  }
21
24
  var mainPort = getMainPort();
25
+ var localServerPort = getLocalServerPort();
22
26
 
23
27
  // 主客户端
24
- if (/_main\//i.test(apiName)) {
28
+ if (/^_main\//i.test(apiName)) {
25
29
  return "http://127.0.0.1:".concat(mainPort, "/").concat(apiName.replace(/^_main\//i, ''));
26
30
  }
31
+ if (/^_video-api\//i.test(apiName)) {
32
+ apiName = apiName.toLocaleLowerCase();
33
+ return "http://127.0.0.1:".concat(localServerPort, "/").concat(apiName.replace(/^_video-api\//i, ''));
34
+ }
27
35
 
28
36
  // 替换第一个 /
29
37
  apiName = apiName.replace(/^\//, '');
@@ -0,0 +1,2 @@
1
+ declare const openChrome: (query: OpenChrome.PropsQuery, isNew: boolean) => void;
2
+ export default openChrome;
@@ -0,0 +1,115 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import AccountManageSettingConfig from "./accountManageSettingConfig";
4
+ import param from "../component/param";
5
+ import Tool from "./Tool";
6
+ import notification from "./notification";
7
+ import userAgent from "./user-agent";
8
+ import VideoApiOpenChrome from "./video-api/open-chrome";
9
+
10
+ // @isNew: 只有 新建账户,才要 isNew
11
+ var openChrome = function openChrome(query, isNew) {
12
+ var settingConfig = AccountManageSettingConfig();
13
+ if (!query.chromePath) {
14
+ query.chromePath = settingConfig.chromePath;
15
+ }
16
+ if (!query.chromePath) {
17
+ notification.notificationError('没找到 Google 浏览器', '请设置 谷歌浏览器地址,或者重新安装 https://google.cn/chrome/');
18
+ return;
19
+ }
20
+ var data = getOpenQuery(query, isNew, settingConfig);
21
+
22
+ //唤起 浏览器;
23
+ // onOpenChromeRun({
24
+ // ...query,
25
+ // ...data,
26
+ // chromeUserDataDir: settingConfig.chromeUserDataDir,
27
+ // chromePath,
28
+ // });
29
+ onOpenChromeRun({
30
+ commandList: data.commandList
31
+ });
32
+ };
33
+ var onOpenChromeRun = /*#__PURE__*/function () {
34
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query) {
35
+ var cmdResult;
36
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
37
+ while (1) switch (_context.prev = _context.next) {
38
+ case 0:
39
+ _context.next = 2;
40
+ return VideoApiOpenChrome(query).catch(function (err) {
41
+ // todo 上报
42
+ console.log('open chrome err:', err);
43
+ });
44
+ case 2:
45
+ cmdResult = _context.sent;
46
+ console.log("cmd:", query);
47
+ if (cmdResult) {}
48
+ case 5:
49
+ case "end":
50
+ return _context.stop();
51
+ }
52
+ }, _callee);
53
+ }));
54
+ return function onOpenChromeRun(_x) {
55
+ return _ref.apply(this, arguments);
56
+ };
57
+ }();
58
+ var getOpenQuery = function getOpenQuery(query, isNew, settingConfig) {
59
+ var cmdList = [];
60
+ var url = query.url;
61
+ var openUrl = url + ((url === null || url === void 0 ? void 0 : url.indexOf('?')) === -1 ? '?' : '&') + param({
62
+ _shipinlvFrom: 'auto',
63
+ _action: query.action || '',
64
+ _platformAccountId: query.platformAccountId,
65
+ _nickname: query.nickname || '',
66
+ _chromeProfileName: query.chromeProfileName || ''
67
+ });
68
+ switch (Tool.getOsName()) {
69
+ case "windows":
70
+ cmdList.push("cmd", "/c", "start");
71
+ if (query.chromePath) {
72
+ cmdList.push("".concat(query.chromePath));
73
+ } else {
74
+ cmdList.push("chrome");
75
+ }
76
+ if (!query.isOpen) {
77
+ cmdList.push("--headless=old");
78
+
79
+ // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
80
+ cmdList.push("--disable-gpu");
81
+ }
82
+ break;
83
+ case "darwin":
84
+ cmdList = ["open"];
85
+ if (isNew) {
86
+ cmdList.push("-n");
87
+ }
88
+ cmdList.push("-a", "".concat(query.chromePath || 'Google Chrome'), "--args");
89
+ if (!query.isOpen) {
90
+ cmdList.push("--headless");
91
+
92
+ // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
93
+ cmdList.push("--disable-gpu");
94
+ }
95
+ break;
96
+ default:
97
+ notification.notificationError('不支持的系统', '发布不支持此系统');
98
+ }
99
+
100
+ // 尺寸
101
+ cmdList.push("--window-size=".concat(window.screen.width, ",").concat(window.screen.height));
102
+ cmdList.push("--user-agent='".concat(userAgent(), "'"));
103
+
104
+ // 不要检查
105
+ cmdList.push('--no-first-run', '--no-default-browser-check', '--disable-default-apps');
106
+ var chromeProfileDir = settingConfig.chromeUserDataDir + '/' + query.chromeProfileName;
107
+ cmdList.push("--user-data-dir=".concat(chromeProfileDir));
108
+ cmdList.push("".concat(openUrl));
109
+ console.log('profileName:', chromeProfileDir);
110
+ return {
111
+ commandList: cmdList,
112
+ chromeProfileDir: chromeProfileDir
113
+ };
114
+ };
115
+ export default openChrome;
@@ -39,7 +39,7 @@ var requestApi = /*#__PURE__*/function () {
39
39
  });
40
40
  case 9:
41
41
  clientIdentity = _context.sent;
42
- postUrl += "&clientIdentity=".concat(clientIdentity);
42
+ postUrl += "&clientIdentity=".concat(clientIdentity || '');
43
43
 
44
44
  // 追加环境参数
45
45
  env = getApiEnv(options === null || options === void 0 ? void 0 : options.env);
@@ -0,0 +1,2 @@
1
+ declare const userAgent: () => string;
2
+ export default userAgent;
@@ -0,0 +1,10 @@
1
+ import Tool from "./Tool";
2
+ var chromeVersion = '120.0.6099.56';
3
+ var darwin = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/".concat(chromeVersion);
4
+ var windows = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/".concat(chromeVersion, " Edg/").concat(chromeVersion);
5
+ var userAgentMore = " Safari/537.36";
6
+ var userAgent = function userAgent() {
7
+ var ua = Tool.getOsName() === 'windows' ? windows : darwin;
8
+ return ua + userAgentMore;
9
+ };
10
+ export default userAgent;
@@ -0,0 +1,2 @@
1
+ declare const VideoApiOpenChrome: (query: OpenChrome.OnOpenChromeRun) => Promise<boolean>;
2
+ export default VideoApiOpenChrome;
@@ -0,0 +1,49 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import * as VideoApiOpenChromeController from "../../service/video-api/VideoApiOpenChromeController";
4
+ var VideoApiOpenChrome = /*#__PURE__*/function () {
5
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(query) {
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 VideoApiOpenChromeController.openChrome(query).catch(function (err) {
17
+ // if( err?.name === "shipinlv-client-not-run" ){
18
+ // return reject( err );
19
+ // }
20
+ console.log('open In Folder err:', err);
21
+ err.message = "\u6253\u5F00 \u8C37\u6B4C\u6D4F\u89C8\u5668\u5931\u8D25\uFF1A".concat(err === null || err === void 0 ? void 0 : err.message);
22
+ reject(err);
23
+ });
24
+ case 2:
25
+ openResult = _context.sent;
26
+ if (openResult) {
27
+ resolve(true);
28
+ }
29
+ case 4:
30
+ case "end":
31
+ return _context.stop();
32
+ }
33
+ }, _callee);
34
+ }));
35
+ return function (_x2, _x3) {
36
+ return _ref2.apply(this, arguments);
37
+ };
38
+ }()));
39
+ case 1:
40
+ case "end":
41
+ return _context2.stop();
42
+ }
43
+ }, _callee2);
44
+ }));
45
+ return function VideoApiOpenChrome(_x) {
46
+ return _ref.apply(this, arguments);
47
+ };
48
+ }();
49
+ export default VideoApiOpenChrome;
@@ -1,2 +1,2 @@
1
- declare const renewalVip: (productName: string) => Promise<unknown>;
1
+ declare const renewalVip: (productName: string, env?: Global.Env | '') => Promise<unknown>;
2
2
  export default renewalVip;
@@ -8,7 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { Fragment as _Fragment } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
10
  var renewalVip = /*#__PURE__*/function () {
11
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(productName) {
11
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(productName, env) {
12
12
  var _userInfo$userVip;
13
13
  var siteInfo, userInfo, userVip, isVip, localSiteInfo;
14
14
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -20,7 +20,8 @@ var renewalVip = /*#__PURE__*/function () {
20
20
  isVip = !!(userVip !== null && userVip !== void 0 && userVip.isVip);
21
21
  localSiteInfo = Tool.getLocalSiteInfo();
22
22
  return _context.abrupt("return", new Promise(function (resolve, reject) {
23
- if (siteInfo.disabledOnlineBuy.includes(productName)) {
23
+ var _siteInfo$disabledOnl;
24
+ if ((_siteInfo$disabledOnl = siteInfo.disabledOnlineBuy) !== null && _siteInfo$disabledOnl !== void 0 && _siteInfo$disabledOnl.includes(productName)) {
24
25
  // 激活码
25
26
  var dialog = Tool.drawer({
26
27
  title: /*#__PURE__*/_jsxs(_Fragment, {
@@ -32,6 +33,7 @@ var renewalVip = /*#__PURE__*/function () {
32
33
  })]
33
34
  }),
34
35
  content: /*#__PURE__*/_jsx(UserProfileVipCard, {
36
+ env: env,
35
37
  onActive: function onActive() {
36
38
  resolve(true);
37
39
  dialog.destroy();
@@ -44,7 +46,7 @@ var renewalVip = /*#__PURE__*/function () {
44
46
  Tool.pageDialog({
45
47
  title: '价格表',
46
48
  content: /*#__PURE__*/_jsx(VipList, {
47
- env: getApiEnv(),
49
+ env: env || getApiEnv(),
48
50
  tableScrollY: "60vh",
49
51
  productType: productName,
50
52
  applyDemoWechatUrl: localSiteInfo.domainUserWeContactQrUrl || localSiteInfo.dealerWeContactQrUrl || localSiteInfo.adminWechatQr,
@@ -68,7 +70,7 @@ var renewalVip = /*#__PURE__*/function () {
68
70
  }
69
71
  }, _callee);
70
72
  }));
71
- return function renewalVip(_x) {
73
+ return function renewalVip(_x, _x2) {
72
74
  return _ref.apply(this, arguments);
73
75
  };
74
76
  }();
@@ -10,6 +10,9 @@ export declare function fileSelect(body: {
10
10
  export declare function folderSelect(body: {
11
11
  defaultPath: string;
12
12
  }, optionsQuery?: ServicesApi.RequestOptions): Promise<LocalFile.FileSelect>;
13
+ export declare function folderCreate(body: {
14
+ folderPath: string;
15
+ }, optionsQuery?: ServicesApi.RequestOptions): Promise<LocalFile.FileCreate>;
13
16
  export declare function openInFolder(body: {
14
17
  filePath: string;
15
18
  }, optionsQuery?: ServicesApi.RequestOptions): Promise<LocalFile.FileSelect>;