@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.
package/dist/index.esm.js CHANGED
@@ -378,7 +378,7 @@ class UtilsGMCookie {
378
378
  url: this.windowApi.window.location.href,
379
379
  name: "",
380
380
  value: "",
381
- domain: this.windowApi.window.location.hostname,
381
+ domain: "",
382
382
  path: "/",
383
383
  secure: true,
384
384
  httpOnly: false,
@@ -397,6 +397,9 @@ class UtilsGMCookie {
397
397
  ";expires=" +
398
398
  new Date(life).toGMTString() +
399
399
  "; path=/";
400
+ if (utils.isNotNull(defaultOption.domain)) {
401
+ cookieStr += "; domain=" + defaultOption.domain;
402
+ }
400
403
  this.windowApi.document.cookie = cookieStr;
401
404
  }
402
405
  catch (error) {
@@ -420,10 +423,13 @@ class UtilsGMCookie {
420
423
  url: this.windowApi.window.location.href,
421
424
  name: "",
422
425
  path: "/",
423
- firstPartyDomain: this.windowApi.window.location.hostname,
426
+ firstPartyDomain: "",
424
427
  };
425
428
  defaultOption = utils.assign(defaultOption, option);
426
- let cookieStr = `${defaultOption.name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${defaultOption.path}; domain=${defaultOption.firstPartyDomain};`;
429
+ let cookieStr = `${defaultOption.name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${defaultOption.path}`;
430
+ if (utils.isNotNull(defaultOption.firstPartyDomain)) {
431
+ cookieStr += `; domain=${defaultOption.firstPartyDomain};`;
432
+ }
427
433
  this.windowApi.document.cookie = cookieStr;
428
434
  }
429
435
  catch (error) {
@@ -5035,7 +5041,7 @@ class Utils {
5035
5041
  this.windowApi = new WindowApi(option);
5036
5042
  }
5037
5043
  /** 版本号 */
5038
- version = "2025.3.24";
5044
+ version = "2025.3.25";
5039
5045
  addStyle(cssText) {
5040
5046
  if (typeof cssText !== "string") {
5041
5047
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");