@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/LICENSE +674 -0
- package/dist/index.amd.js +10 -4
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +10 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +10 -4
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +10 -4
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +10 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/UtilsGMCookie.d.ts +3 -4
- package/dist/types/src/types/UtilsGMCookie.d.ts +2 -2
- package/package.json +52 -52
- package/src/Utils.ts +1 -1
- package/src/UtilsGMCookie.ts +13 -9
- package/src/types/UtilsGMCookie.d.ts +2 -2
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:
|
|
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:
|
|
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}
|
|
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.
|
|
5044
|
+
version = "2025.3.25";
|
|
5039
5045
|
addStyle(cssText) {
|
|
5040
5046
|
if (typeof cssText !== "string") {
|
|
5041
5047
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|