abler-api 1.0.33 → 1.0.35
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/cjs/pp-util.js +9 -6
- package/package.json +4 -4
package/dist/cjs/pp-util.js
CHANGED
|
@@ -376,7 +376,7 @@ class apiUtil$2 {
|
|
|
376
376
|
continue;
|
|
377
377
|
} catch (e) {}
|
|
378
378
|
}
|
|
379
|
-
let x = JSON.
|
|
379
|
+
let x = JSON.convertDate(key, value);
|
|
380
380
|
if (x !== value) {
|
|
381
381
|
obj[key] = x;
|
|
382
382
|
}
|
|
@@ -747,14 +747,17 @@ class apiUtil$2 {
|
|
|
747
747
|
req.accessToken = req.accessToken || apiUtil$2.extractToken(req);
|
|
748
748
|
const tokenKey = apiUtil$2.userTokenStoreKey(req.accessToken);
|
|
749
749
|
const expireTime = apiUtil$2.tokenExpireTime(req);
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
try {
|
|
751
|
+
const userInfo = await apiUtil$2.restoreTokenData(tokenKey, expireTime);
|
|
752
|
+
req.userInfo = apiUtil$2.setUserIdNo(userInfo, userInfo?._idNo);
|
|
753
|
+
if (req.tokenValidater) {
|
|
754
|
+
await req.tokenValidater(req.userInfo, req);
|
|
755
|
+
}
|
|
753
756
|
return true;
|
|
754
|
-
}
|
|
757
|
+
} catch (e) {
|
|
755
758
|
// 如果给定的token不存在,看看是不是平台内部调用
|
|
756
759
|
return await apiUtil$2.checkInternalToken(req);
|
|
757
|
-
}
|
|
760
|
+
}
|
|
758
761
|
}
|
|
759
762
|
|
|
760
763
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abler-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"description": "API服务相关工具",
|
|
5
5
|
"main": "./dist/cjs/pp-util.js",
|
|
6
6
|
"-module": "./dist/es/pp-util.js",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"author": "peng_peng",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"abler-db": "^1.0.
|
|
18
|
+
"abler-db": "^1.0.42",
|
|
19
19
|
"abler-i18n": "^1.0.2",
|
|
20
|
-
"abler-messenger": "^1.0.
|
|
20
|
+
"abler-messenger": "^1.0.32",
|
|
21
21
|
"abler-net": "^1.0.9",
|
|
22
22
|
"abler-util": "^1.0.9",
|
|
23
23
|
"basic-auth": "^2.0.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"rollup-plugin-json": "^4.0.0",
|
|
44
44
|
"rollup-plugin-terser": "^7.0.2"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6d4380c9b98171ed986731b27e5ac628562afe88"
|
|
47
47
|
}
|