@gadmin2n/schematics 0.0.155 → 0.0.156
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/lib/application/files/gadmin2-game-angle-demo/CODEBUDDY.md +1 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/gitignore +2 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/pnpm-workspace.yaml +3 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/TransferExportModal.tsx +11 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/ExportModal.tsx +11 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/ExportModal.tsx +11 -1
- package/package.json +1 -1
|
@@ -6,6 +6,16 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
|
|
7
7
|
export type TransferEntity = 'user' | 'role' | 'page' | 'resource';
|
|
8
8
|
|
|
9
|
+
// 后端按转发后的 Host 拼 URL(正式环境会是内网地址),统一改写为当前浏览器 origin
|
|
10
|
+
const toCurrentOrigin = (u: string) => {
|
|
11
|
+
try {
|
|
12
|
+
const parsed = new URL(u);
|
|
13
|
+
return `${window.location.origin}${parsed.pathname}${parsed.search}`;
|
|
14
|
+
} catch {
|
|
15
|
+
return u;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
9
19
|
interface TransferExportModalProps {
|
|
10
20
|
open: boolean;
|
|
11
21
|
onClose: () => void;
|
|
@@ -37,7 +47,7 @@ export function TransferExportModal({
|
|
|
37
47
|
setUrl('');
|
|
38
48
|
setLoading(true);
|
|
39
49
|
customRequest<{ url: string }>(exportTokenEndpoint, 'POST')
|
|
40
|
-
.then((res) => setUrl(res.url))
|
|
50
|
+
.then((res) => setUrl(toCurrentOrigin(res.url)))
|
|
41
51
|
.catch((e: any) =>
|
|
42
52
|
message.error(e?.message ?? t('transfer.export.failed')),
|
|
43
53
|
)
|
|
@@ -9,6 +9,16 @@ interface ExportModalProps {
|
|
|
9
9
|
onClose: () => void;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
// 后端按转发后的 Host 拼 URL(正式环境会是内网地址),统一改写为当前浏览器 origin
|
|
13
|
+
const toCurrentOrigin = (u: string) => {
|
|
14
|
+
try {
|
|
15
|
+
const parsed = new URL(u);
|
|
16
|
+
return `${window.location.origin}${parsed.pathname}${parsed.search}`;
|
|
17
|
+
} catch {
|
|
18
|
+
return u;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
12
22
|
export function ExportModal({ open, canvasId, onClose }: ExportModalProps) {
|
|
13
23
|
const [url, setUrl] = useState<string>('');
|
|
14
24
|
const [loading, setLoading] = useState(false);
|
|
@@ -18,7 +28,7 @@ export function ExportModal({ open, canvasId, onClose }: ExportModalProps) {
|
|
|
18
28
|
setUrl('');
|
|
19
29
|
setLoading(true);
|
|
20
30
|
generateExportToken(canvasId)
|
|
21
|
-
.then((res) => setUrl(res.url))
|
|
31
|
+
.then((res) => setUrl(toCurrentOrigin(res.url)))
|
|
22
32
|
.catch((e: any) =>
|
|
23
33
|
message.error(e?.message ?? 'Failed to generate export URL'),
|
|
24
34
|
)
|
|
@@ -10,6 +10,16 @@ interface ExportModalProps {
|
|
|
10
10
|
onClose: () => void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
// 后端按转发后的 Host 拼 URL(正式环境会是内网地址),统一改写为当前浏览器 origin
|
|
14
|
+
const toCurrentOrigin = (u: string) => {
|
|
15
|
+
try {
|
|
16
|
+
const parsed = new URL(u);
|
|
17
|
+
return `${window.location.origin}${parsed.pathname}${parsed.search}`;
|
|
18
|
+
} catch {
|
|
19
|
+
return u;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
13
23
|
export function ExportModal({ open, workflowId, onClose }: ExportModalProps) {
|
|
14
24
|
const { t } = useTranslation('workflow');
|
|
15
25
|
const [url, setUrl] = useState<string>('');
|
|
@@ -23,7 +33,7 @@ export function ExportModal({ open, workflowId, onClose }: ExportModalProps) {
|
|
|
23
33
|
`workflow/${workflowId}/export-token`,
|
|
24
34
|
'POST',
|
|
25
35
|
)
|
|
26
|
-
.then((res) => setUrl(res.url))
|
|
36
|
+
.then((res) => setUrl(toCurrentOrigin(res.url)))
|
|
27
37
|
.catch((e: any) => message.error(e?.message ?? t('export.failed')))
|
|
28
38
|
.finally(() => setLoading(false));
|
|
29
39
|
}
|