@fe-free/core 2.8.9 → 2.8.10
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/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/src/core_app/index.tsx +9 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"safe-stable-stringify": "^2.5.0",
|
|
43
43
|
"vanilla-jsoneditor": "^0.23.1",
|
|
44
44
|
"zustand": "^4.5.4",
|
|
45
|
-
"@fe-free/tool": "2.8.
|
|
45
|
+
"@fe-free/tool": "2.8.10"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@ant-design/pro-components": "2.8.9",
|
package/src/core_app/index.tsx
CHANGED
|
@@ -7,6 +7,13 @@ import { BrowserRouter as Router, useNavigate } from 'react-router-dom';
|
|
|
7
7
|
import { routeTool } from '../route';
|
|
8
8
|
import { customValueTypeMap } from '../value_type_map';
|
|
9
9
|
|
|
10
|
+
function getPathname(src?: string) {
|
|
11
|
+
if (!src) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return src.startsWith('/') ? src : new URL(src).pathname;
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
function CheckUpdate({ basename }: { basename: string }) {
|
|
11
18
|
const { modal } = App.useApp();
|
|
12
19
|
|
|
@@ -24,7 +31,7 @@ function CheckUpdate({ basename }: { basename: string }) {
|
|
|
24
31
|
const doc = parser.parseFromString(html, 'text/html');
|
|
25
32
|
const nextMainScript = doc.querySelector('[data-name="mainScript"]');
|
|
26
33
|
const src = nextMainScript?.getAttribute('src');
|
|
27
|
-
return src
|
|
34
|
+
return getPathname(src || undefined);
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
let ing = false;
|
|
@@ -50,7 +57,7 @@ function CheckUpdate({ basename }: { basename: string }) {
|
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
const src = mainScript.getAttribute('src');
|
|
53
|
-
const pathname = src
|
|
60
|
+
const pathname = getPathname(src || undefined);
|
|
54
61
|
|
|
55
62
|
const checkUpdateInterval = parseInt(
|
|
56
63
|
localStorage.getItem('__free-checkUpdateInterval') || '60000',
|