feat: add public id field to resource (#1451)

* feat: add public id field to resource

* feat: support reset resource link
This commit is contained in:
boojack
2023-04-03 13:41:27 +08:00
committed by GitHub
parent c9a5df81ce
commit 1cab30f32f
15 changed files with 179 additions and 190 deletions

View File

@ -1,6 +1,3 @@
export const getResourceUrl = (resource: Resource, withOrigin = true) => {
if (resource.externalLink) {
return resource.externalLink;
}
return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${encodeURIComponent(resource.filename)}`;
return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${resource.publicId}`;
};