激光材料数据平台 1.3.0

公开数据看板、四位 Key 录入面板、管理后台与三级权限、动态字段配置、
PostgreSQL/SQLite 双支持、数据库备份,以及本版新增的成品图上传与预览。

图片相关:
- 录入表单支持相册选图与手机端直接拍照,每条记录最多 6 张
- 浏览器内压缩到最长边 1600 并剥离 EXIF,入库统一为 JPG/PNG
- 二进制直接入库,现有备份自动覆盖图片,部署无需新增卷
- 详情页缩略图宫格与全屏 lightbox,公开看板同样可见

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-26 22:06:02 +08:00
co-authored by Claude Fable 5
commit edfb216561
49 changed files with 3922 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
from app.security import entry_key_hash, hash_password, validate_password, verify_password
def test_password_hash_round_trip():
encoded = hash_password("StrongPass123")
assert "StrongPass123" not in encoded
assert verify_password("StrongPass123", encoded)
assert not verify_password("wrong", encoded)
def test_password_policy():
assert validate_password("short")
assert validate_password("onlyletterslong")
assert validate_password("StrongPass123") is None
def test_entry_key_hash_is_deterministic_without_storing_plaintext():
first = entry_key_hash("1234")
assert first == entry_key_hash("1234")
assert first != entry_key_hash("4321")
assert "1234" not in first