mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 03:32:20 +08:00
Web: fix file url
This commit is contained in:
parent
c059975165
commit
254978c43f
|
@ -60,6 +60,7 @@ namespace BililiveRecorder.Web.Api
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var pathTrimmed = path.Trim('/');
|
||||||
fileLikes.Add(new FileDto
|
fileLikes.Add(new FileDto
|
||||||
{
|
{
|
||||||
Name = content.Name,
|
Name = content.Name,
|
||||||
|
@ -67,7 +68,7 @@ namespace BililiveRecorder.Web.Api
|
||||||
Size = content.Length,
|
Size = content.Length,
|
||||||
|
|
||||||
// Path.Combine 在 Windows 上会用 \
|
// Path.Combine 在 Windows 上会用 \
|
||||||
Url = "/file/" + path.Trim('/') + '/' + content.Name,
|
Url = "/file/" + (pathTrimmed.Length > 0 ? pathTrimmed + '/' : string.Empty) + content.Name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user