!10 FileManage 保存文件到本地后,输出文件路径错误问题解决
Merge pull request !10 from ktianc/master
This commit is contained in:
commit
aca6c3d4f9
@ -72,9 +72,10 @@ class FileManage(FileBase):
|
||||
if not await save_path.parent.exists():
|
||||
await save_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
await save_path.write_bytes(await self.file.read())
|
||||
remote_path = path.replace(STATIC_ROOT, '').replace("\\", '/')
|
||||
return {
|
||||
"local_path": f"{STATIC_ROOT}/{self.path}",
|
||||
"remote_path": f"{STATIC_URL}/{self.path}"
|
||||
"local_path": path,
|
||||
"remote_path": f"{STATIC_URL}/{remote_path}"
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
Loading…
x
Reference in New Issue
Block a user