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