@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.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:
|
|
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:
|
|
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}
|
|
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.
|
|
5046
|
+
version = "2025.3.25";
|
|
5041
5047
|
addStyle(cssText) {
|
|
5042
5048
|
if (typeof cssText !== "string") {
|
|
5043
5049
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|