@whitesev/utils 2.6.2 → 2.6.3

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.
@@ -383,7 +383,7 @@ System.register('Utils', [], (function (exports) {
383
383
  url: this.windowApi.window.location.href,
384
384
  name: "",
385
385
  value: "",
386
- domain: this.windowApi.window.location.hostname,
386
+ domain: "",
387
387
  path: "/",
388
388
  secure: true,
389
389
  httpOnly: false,
@@ -402,6 +402,9 @@ System.register('Utils', [], (function (exports) {
402
402
  ";expires=" +
403
403
  new Date(life).toGMTString() +
404
404
  "; path=/";
405
+ if (utils.isNotNull(defaultOption.domain)) {
406
+ cookieStr += "; domain=" + defaultOption.domain;
407
+ }
405
408
  this.windowApi.document.cookie = cookieStr;
406
409
  }
407
410
  catch (error) {
@@ -425,10 +428,13 @@ System.register('Utils', [], (function (exports) {
425
428
  url: this.windowApi.window.location.href,
426
429
  name: "",
427
430
  path: "/",
428
- firstPartyDomain: this.windowApi.window.location.hostname,
431
+ firstPartyDomain: "",
429
432
  };
430
433
  defaultOption = utils.assign(defaultOption, option);
431
- let cookieStr = `${defaultOption.name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${defaultOption.path}; domain=${defaultOption.firstPartyDomain};`;
434
+ let cookieStr = `${defaultOption.name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${defaultOption.path}`;
435
+ if (utils.isNotNull(defaultOption.firstPartyDomain)) {
436
+ cookieStr += `; domain=${defaultOption.firstPartyDomain};`;
437
+ }
432
438
  this.windowApi.document.cookie = cookieStr;
433
439
  }
434
440
  catch (error) {
@@ -5040,7 +5046,7 @@ System.register('Utils', [], (function (exports) {
5040
5046
  this.windowApi = new WindowApi(option);
5041
5047
  }
5042
5048
  /** 版本号 */
5043
- version = "2025.3.24";
5049
+ version = "2025.3.25";
5044
5050
  addStyle(cssText) {
5045
5051
  if (typeof cssText !== "string") {
5046
5052
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");