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