fix(web): 知识库图谱预览与保存修复(CSP 放行 S3 图片源 + imageUrl 表单注册)
- server.cjs: img-src 放行 http://100.83.103.1:7480,修复编辑页预览图被 CSP 拦截 - Knowledge.tsx: 新增隐藏 Form.Item name=imageUrl,修复 validateFields 提交时丢弃图片 URL - 部署至 100.83.103.1:5174(备份 /home/pan/backups/web-20260812-1605) - 补绑白僵病 image_url(UPDATE 1),更新故障排查/开发交接/变更记录
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ const SECURITY_HEADERS = {
|
||||
'X-Frame-Options': 'DENY',
|
||||
'Referrer-Policy': 'no-referrer',
|
||||
'Content-Security-Policy':
|
||||
"default-src 'self'; img-src 'self' data: blob:; media-src 'self' blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss:; font-src 'self' data:; object-src 'none'; frame-ancestors 'none'",
|
||||
"default-src 'self'; img-src 'self' data: blob: http://100.83.103.1:7480; media-src 'self' blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss:; font-src 'self' data:; object-src 'none'; frame-ancestors 'none'",
|
||||
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
|
||||
};
|
||||
|
||||
|
||||
@@ -183,6 +183,10 @@ function DiseaseTab() {
|
||||
)}
|
||||
</Upload>
|
||||
</Form.Item>
|
||||
{/* imageUrl 通过隐藏字段注册到表单,保证 validateFields 提交时携带(修复:未注册字段会被丢弃) */}
|
||||
<Form.Item name="imageUrl" hidden>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label="病原" name="pathogen">
|
||||
<Input.TextArea rows={2} />
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user