重构index.html

This commit is contained in:
lan-air
2022-12-13 10:48:09 +08:00
parent 31f67fae3f
commit 24ad5e08ca
5 changed files with 150 additions and 131 deletions
+4 -2
View File
@@ -31,8 +31,10 @@ class FileSystemStorage:
return text
async def delete_file(self, file):
filepath = self.DATA_ROOT / file['text'].lstrip(self.STATIC_URL + '/')
await asyncio.to_thread(os.remove, filepath)
# 是文件就删除
if file['type'] != 'text':
filepath = self.DATA_ROOT / file['text'].lstrip(self.STATIC_URL + '/')
await asyncio.to_thread(os.remove, filepath)
async def delete_files(self, files):
for file in files: