xctc-utils 1.6.21 → 1.6.22
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/weixin/index.js +6 -6
- package/package.json +1 -1
package/dist/weixin/index.js
CHANGED
|
@@ -67,13 +67,13 @@ function getUrlCode(config) {
|
|
|
67
67
|
isAuth = search.includes("state=state");
|
|
68
68
|
}
|
|
69
69
|
// 获取地址栏返回 code 参数值
|
|
70
|
-
var
|
|
70
|
+
var localParamsData = (0, index_1.getSessionStorage)("urlParamsData") || "";
|
|
71
71
|
// 本地未存储微信授权 code 值, 并且地址栏携带有 code 值 ,则先存储该值
|
|
72
|
-
if (
|
|
72
|
+
if (codeIndex != -1 && isAuth) {
|
|
73
73
|
params.get({ keys: ['code'], cache: "session", key: cryptokey, iv: cryptoiv });
|
|
74
74
|
}
|
|
75
75
|
// 如果本地已经存储 微信授权返回的 code 值,证明用户在执行刷新操作,不再执行微信授权逻辑
|
|
76
|
-
if (
|
|
76
|
+
if ((localParamsData === null || localParamsData === void 0 ? void 0 : localParamsData.code) && stateIndex == -1 && codeIndex == -1 && !isAuth) {
|
|
77
77
|
if (debuggerStatus) {
|
|
78
78
|
alert("本地已经存储 code ,不再执行微信授权逻辑");
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ function getUrlCode(config) {
|
|
|
81
81
|
}
|
|
82
82
|
// 如果链接地址中带有code,证明执行微信授权登录,并返回授权所需的 code 参数
|
|
83
83
|
if (codeIndex >= 0 && isAuth) {
|
|
84
|
-
if (
|
|
84
|
+
if (localParamsData === null || localParamsData === void 0 ? void 0 : localParamsData.code) {
|
|
85
85
|
// localCode 存在,用户已执行微信跳转链接,用户可能执行当前网页的刷新操作
|
|
86
86
|
if (debuggerStatus) {
|
|
87
87
|
alert("codeIndex 》 0 ,本地已经存储 code ,不再执行微信授权逻辑");
|
|
@@ -102,11 +102,11 @@ function getUrlCode(config) {
|
|
|
102
102
|
if (debuggerStatus) {
|
|
103
103
|
alert("用户通过分享链接进入系统,无code参数 ,跳转到code授权页面");
|
|
104
104
|
}
|
|
105
|
-
params.urlStateParams();
|
|
105
|
+
params.urlStateParams("urlParamsData", cryptokey, cryptoiv);
|
|
106
106
|
return getCode(); // 微信授权页面获取CODE
|
|
107
107
|
}
|
|
108
108
|
// && stateIndex == -1 && codeIndex == -1
|
|
109
|
-
if (!
|
|
109
|
+
if (!(localParamsData === null || localParamsData === void 0 ? void 0 : localParamsData.code) && codeIndex == -1) {
|
|
110
110
|
if (debuggerStatus) {
|
|
111
111
|
alert("无本地code参数 ,跳转到code授权页面");
|
|
112
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xctc-utils",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.22",
|
|
4
4
|
"description": "localStorage存储\r ```\r sessionStorage存储\r ```\r crypto-js加密、解密\r ```\r 微信授权登录、微信分享\r ```\r 设备环境获取\r ```\r 是否是微信浏览器\r ```\r 时间戳转时间,字符串转时间戳",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|