component-shipinlv 2.0.15 → 2.0.17

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.
@@ -162,7 +162,7 @@ declare const Tool: {
162
162
  getTitleByPath(path: string): string;
163
163
  getDirByPath(path: string): string;
164
164
  h5Pay(query: Pay.H5PayQuery): void;
165
- notification(type: "info" | "error" | "success" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
165
+ notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
166
166
  notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
167
167
  notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
168
168
  notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
package/dist/lib/Tool.js CHANGED
@@ -1100,7 +1100,6 @@ var Tool = _objectSpread(_objectSpread({
1100
1100
  return Date.now() - Tool.getTimeOffset();
1101
1101
  },
1102
1102
  getOsName: function getOsName() {
1103
- return 'windows';
1104
1103
  var userAgent = navigator.userAgent || window.opera;
1105
1104
 
1106
1105
  // Windows
@@ -1108,7 +1107,8 @@ var Tool = _objectSpread(_objectSpread({
1108
1107
  return "windows";
1109
1108
  }
1110
1109
  // macOS
1111
- if (/mac/i.test(userAgent)) {
1110
+ // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
1111
+ if (/Mac\s/i.test(userAgent)) {
1112
1112
  return "darwin";
1113
1113
  }
1114
1114
 
@@ -170,7 +170,7 @@ var getOpenQuery = /*#__PURE__*/function () {
170
170
  });
171
171
  chromeProfileDir = settingConfig.chromeUserDataDir + '/' + query.chromeProfileName;
172
172
  _context4.t0 = Tool.getOsName();
173
- _context4.next = _context4.t0 === "windows" ? 8 : _context4.t0 === "darwin" ? 11 : 16;
173
+ _context4.next = _context4.t0 === "windows" ? 8 : _context4.t0 === "darwin" ? 11 : 15;
174
174
  break;
175
175
  case 8:
176
176
  // 艹,屎一样的 windows cmd
@@ -188,23 +188,24 @@ var getOpenQuery = /*#__PURE__*/function () {
188
188
  // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
189
189
  cmdList.push("--disable-gpu");
190
190
  }
191
- return _context4.abrupt("break", 17);
191
+ return _context4.abrupt("break", 16);
192
192
  case 11:
193
- cmdList = ["open"];
193
+ // cmdList = [ `open`, `-a` ];
194
+
195
+ cmdList = ["".concat(query.chromePath || 'Google Chrome'), "--args"];
194
196
  if (isNew) {
195
197
  cmdList.push("-n");
196
198
  }
197
- cmdList.push("-a", "".concat(query.chromePath || 'Google Chrome'), "--args");
198
199
  if (!query.isOpen) {
199
200
  cmdList.push("--headless");
200
201
 
201
202
  // --disable-gpu是为了解决一些在无头模式下可能出现的GPU相关的问题
202
203
  cmdList.push("--disable-gpu");
203
204
  }
204
- return _context4.abrupt("break", 17);
205
- case 16:
205
+ return _context4.abrupt("break", 16);
206
+ case 15:
206
207
  notification.notificationError('不支持的系统', '发布不支持此系统');
207
- case 17:
208
+ case 16:
208
209
  position = {
209
210
  x: 0,
210
211
  y: 0
@@ -222,18 +223,18 @@ var getOpenQuery = /*#__PURE__*/function () {
222
223
 
223
224
  // 不要检查
224
225
  cmdList.push('--no-first-run', '--no-default-browser-check', '--disable-default-apps');
225
- _context4.next = 26;
226
+ _context4.next = 25;
226
227
  return getPublishExtensionDir(env).catch(function (err) {
227
228
  notification.notificationError('获取插件地址失败', err.message);
228
229
  });
229
- case 26:
230
+ case 25:
230
231
  publishExtensionDir = _context4.sent;
231
232
  if (publishExtensionDir) {
232
- _context4.next = 29;
233
+ _context4.next = 28;
233
234
  break;
234
235
  }
235
236
  return _context4.abrupt("return", Promise.reject(new Error('获取插件地址失败')));
236
- case 29:
237
+ case 28:
237
238
  cmdList.push("--load-extension=".concat(publishExtensionDir));
238
239
  cmdList.push("".concat(openUrl));
239
240
  console.log('profileName:', cmdList, chromeProfileDir);
@@ -241,7 +242,7 @@ var getOpenQuery = /*#__PURE__*/function () {
241
242
  commandList: cmdList,
242
243
  chromeProfileDir: chromeProfileDir
243
244
  });
244
- case 33:
245
+ case 32:
245
246
  case "end":
246
247
  return _context4.stop();
247
248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "2.0.15",
3
+ "version": "2.0.17",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",