component-shipinlv 1.1.27 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/VideoPublish/account-manage/home.js +24 -4
- package/dist/VideoPublish/account-manage/list.d.ts +1 -0
- package/dist/VideoPublish/account-manage/list.js +68 -24
- package/dist/VideoPublish/account-manage/setting/index.js +43 -4
- package/dist/VideoPublish/log/index.js +90 -44
- package/dist/VideoPublish/log/index.less +1 -1
- package/dist/VideoPublish/publish-task-plan/index.js +14 -2
- package/dist/VideoPublish/publish-task-plan/tool-bak.txt +219 -0
- package/dist/VideoPublish/publish-task-plan/tool.d.ts +14 -4
- package/dist/VideoPublish/publish-task-plan/tool.js +301 -83
- package/dist/VideoPublish/video-account/index.js +5 -2
- package/dist/base/folderCreate.d.ts +2 -0
- package/dist/base/folderCreate.js +56 -0
- package/dist/component/folder-select.d.ts +1 -0
- package/dist/component/folder-select.js +46 -12
- package/dist/component/param.d.ts +5 -0
- package/dist/component/param.js +9 -0
- package/dist/component/sse.d.ts +11 -0
- package/dist/component/sse.js +66 -0
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/lib/Tool.js +2 -2
- package/dist/lib/event.js +2 -2
- package/dist/lib/getApiUrl.d.ts +1 -0
- package/dist/lib/getApiUrl.js +9 -1
- package/dist/lib/openChrome.d.ts +2 -0
- package/dist/lib/openChrome.js +115 -0
- package/dist/lib/request.js +1 -1
- package/dist/lib/user-agent.d.ts +2 -0
- package/dist/lib/user-agent.js +10 -0
- package/dist/lib/video-api/open-chrome.d.ts +2 -0
- package/dist/lib/video-api/open-chrome.js +49 -0
- package/dist/service/local/FileController.d.ts +3 -0
- package/dist/service/local/FileController.js +59 -32
- package/dist/service/video-api/VideoApiOpenChromeController.d.ts +1 -0
- package/dist/service/video-api/VideoApiOpenChromeController.js +27 -0
- package/dist/types/ApiLocal.d.ts +19 -0
- package/dist/types/ApiLocal.js +0 -0
- package/dist/types/OpenChrome.d.ts +16 -0
- package/dist/types/OpenChrome.js +0 -0
- package/dist/types/PublishTaskPlan.d.ts +7 -1
- package/dist/types/PublishVideo.d.ts +11 -0
- package/dist/types/PublishVideo.js +0 -0
- package/dist/types/VideoPublishLog.d.ts +4 -1
- package/dist/typings/LocalFile.d.ts +3 -0
- package/dist/typings/VideoPublishAccountManageSetting.d.ts +1 -0
- package/dist/typings/VideoPublishVideoAccount.d.ts +3 -0
- package/dist/window.d.ts +1 -0
- package/package.json +1 -1
@@ -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 =
|
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
|
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
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
95
|
+
autoCreateDirName = ((_autoCreateDirName = autoCreateDirName) === null || _autoCreateDirName === void 0 ? void 0 : _autoCreateDirName.replace(/^\//, '')) || '';
|
96
|
+
if (!selectFolderPath) {
|
97
|
+
_context.next = 33;
|
98
|
+
break;
|
94
99
|
}
|
95
|
-
|
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,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;
|
package/dist/lib/Tool.d.ts
CHANGED
@@ -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: "
|
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
|
// 一级,子集的子集
|
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
|
// 一级,子集的子集
|
package/dist/lib/getApiUrl.d.ts
CHANGED
@@ -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;
|
package/dist/lib/getApiUrl.js
CHANGED
@@ -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 (
|
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,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;
|
package/dist/lib/request.js
CHANGED
@@ -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,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,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;
|
@@ -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>;
|