!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():
|
if not await save_path.parent.exists():
|
||||||
await save_path.parent.mkdir(parents=True, exist_ok=True)
|
await save_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
await save_path.write_bytes(await self.file.read())
|
await save_path.write_bytes(await self.file.read())
|
||||||
|
remote_path = path.replace(STATIC_ROOT, '').replace("\\", '/')
|
||||||
return {
|
return {
|
||||||
"local_path": f"{STATIC_ROOT}/{self.path}",
|
"local_path": path,
|
||||||
"remote_path": f"{STATIC_URL}/{self.path}"
|
"remote_path": f"{STATIC_URL}/{remote_path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user