Skip to content

Commit

Permalink
fix: 基础目录设置
Browse files Browse the repository at this point in the history
  • Loading branch information
vastsa committed Jan 18, 2024
1 parent 029307a commit c6d538b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from apps.base.views import share_api
from apps.admin.views import admin_api
from core.settings import data_root, settings
from core.settings import data_root, settings, BASE_DIR
from core.tasks import delete_expire_files
from core.utils import max_save_times_desc

Expand All @@ -31,13 +31,13 @@
async def assets(file_path: str):
if settings.max_save_seconds > 0:
if re.match(r'SendView-[\d|a-f|A-F]+\.js', file_path):
with open(f'./fcb-fronted/dist/assets/{file_path}', 'r', encoding='utf-8') as f:
with open(BASE_DIR / f'./fcb-fronted/dist/assets/{file_path}', 'r', encoding='utf-8') as f:
# 删除永久保存选项
content = f.read()
content = content.replace('_(c,{label:e(r)("send.expireData.forever"),value:"forever"},null,8,["label"]),', '')
return HTMLResponse(content=content, media_type='text/javascript')
if re.match(r'index-[\d|a-f|A-F]+\.js', file_path):
with open(f'./fcb-fronted/dist/assets/{file_path}', 'r', encoding='utf-8') as f:
with open(BASE_DIR / f'./fcb-fronted/dist/assets/{file_path}', 'r', encoding='utf-8') as f:
# 更改本文描述
desc_zh, desc_en = await max_save_times_desc(settings.max_save_seconds)
content = f.read()
Expand Down

0 comments on commit c6d538b

Please sign in to comment.