完成开户方式图片路径的修改
This commit is contained in:
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-CV-e6vqH.js"></script>
|
<script type="module" crossorigin src="/assets/index-gOfCWO4q.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-eLRg4pQk.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-eLRg4pQk.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -23,6 +23,20 @@ const formatDateTime = (dateStr: string) => {
|
|||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 安全拼接URL,避免双斜杠
|
||||||
|
const buildUrl = (path: string): string => {
|
||||||
|
const baseUrl = import.meta.env.VITE_API_BASE || "http://localhost:8000";
|
||||||
|
// 如果已经是完整URL(以http://或https://开头),直接返回
|
||||||
|
if (path.startsWith('http://') || path.startsWith('https://')) {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
// 移除路径开头的斜杠(如果有)
|
||||||
|
const cleanPath = path.startsWith('/') ? path.slice(1) : path;
|
||||||
|
// 移除baseUrl结尾的斜杠(如果有)
|
||||||
|
const cleanBase = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;
|
||||||
|
return `${cleanBase}/${cleanPath}`;
|
||||||
|
};
|
||||||
|
|
||||||
interface AuthorizationData {
|
interface AuthorizationData {
|
||||||
id: string;
|
id: string;
|
||||||
status: string;
|
status: string;
|
||||||
@@ -363,7 +377,7 @@ const AuthorizationPage: React.FC = () => {
|
|||||||
<div style={{ width: '100%', height: 120, marginBottom: 12, borderRadius: 8, overflow: 'hidden' }}>
|
<div style={{ width: '100%', height: 120, marginBottom: 12, borderRadius: 8, overflow: 'hidden' }}>
|
||||||
{item.thumb ? (
|
{item.thumb ? (
|
||||||
<img
|
<img
|
||||||
src={item.thumb}
|
src={buildUrl(item.thumb)}
|
||||||
alt={item.typeName}
|
alt={item.typeName}
|
||||||
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
|
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user