xctc-utils 1.4.9 → 1.5.1
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.d.ts +1 -0
- package/dist/weixin/index.js +7 -1
- package/package.json +1 -1
package/dist/weixin/index.d.ts
CHANGED
package/dist/weixin/index.js
CHANGED
|
@@ -108,7 +108,7 @@ function cryptoConfig(key, iv) {
|
|
|
108
108
|
}
|
|
109
109
|
// 执行微信登录
|
|
110
110
|
function weixinLogin(code) {
|
|
111
|
-
var appId = weixinConfig.appId, http = weixinConfig.http, stateKey = weixinConfig.stateKey;
|
|
111
|
+
var appId = weixinConfig.appId, http = weixinConfig.http, stateKey = weixinConfig.stateKey, redirectUri = weixinConfig.redirectUri;
|
|
112
112
|
if (!appId)
|
|
113
113
|
return;
|
|
114
114
|
var obj = {
|
|
@@ -136,6 +136,9 @@ function weixinLogin(code) {
|
|
|
136
136
|
(0, index_1.useLocalStorage)(key, item);
|
|
137
137
|
}
|
|
138
138
|
var url = loc.origin;
|
|
139
|
+
if (redirectUri) {
|
|
140
|
+
url = encodeURIComponent(redirectUri);
|
|
141
|
+
}
|
|
139
142
|
var hashVal = loc.hash;
|
|
140
143
|
var state = (0, index_1.getSessionStorage)(stateKey);
|
|
141
144
|
var str = "";
|
|
@@ -260,6 +263,9 @@ function weixinShareConfig(config) {
|
|
|
260
263
|
if (!config['http'])
|
|
261
264
|
return;
|
|
262
265
|
var url = loc.href.split("#")[0];
|
|
266
|
+
if (config['url']) {
|
|
267
|
+
url = config['url'];
|
|
268
|
+
}
|
|
263
269
|
var param = {
|
|
264
270
|
url: url,
|
|
265
271
|
appId: config.appId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xctc-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
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",
|