fix: source map 禁用 + MD5 改 SHA256

①vite build sourcemap: false,防止源码泄露
②tos_client.py 文件去重哈希从 MD5 改为 SHA256

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
seaislee1209 2026-03-22 21:58:52 +08:00
parent 9a6a8c964a
commit 493b30c6b9
2 changed files with 4 additions and 1 deletions

View File

@ -47,7 +47,7 @@ def upload_file(file_obj, folder='uploads'):
content = file_obj.read() content = file_obj.read()
# Use content hash as key for dedup # Use content hash as key for dedup
content_hash = hashlib.md5(content).hexdigest() content_hash = hashlib.sha256(content).hexdigest()
key = f'{folder}/{content_hash}.{ext}' key = f'{folder}/{content_hash}.{ext}'
url = f'{settings.TOS_CDN_DOMAIN}/{key}' url = f'{settings.TOS_CDN_DOMAIN}/{key}'

View File

@ -4,6 +4,9 @@ import react from '@vitejs/plugin-react'
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
build: {
sourcemap: false,
},
server: { server: {
proxy: { proxy: {
'/api': { '/api': {