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