優化顯示與增強反作弊

This commit is contained in:
Sahik committed 2026-11-25 14:28:56 +08:00
1 parent d2be83ee77
commit 5bd77d2599
30 files changed
+764 -106

No files matched your search

+1
View File
@@ -195,6 +195,7 @@ def approve(sid: int, admin=Depends(admin_user), conn: sqlite3.Connection = Depe
os.close(fd)
try:
shutil.copyfile(src, tmp)
os.chmod(tmp, 0o644) # mkstemp 是 0600,圖庫要讓 NAS 上的其他帳號也讀得到
os.replace(tmp, config.MEME_DIR / name)
except BaseException:
Path(tmp).unlink(missing_ok=True)