fix: return external link directly (#1465)

* fix: return external link directly

* chore: update
This commit is contained in:
boojack
2023-04-04 08:31:11 +08:00
committed by GitHub
parent 5361f76b11
commit 6ff7cfddda
4 changed files with 16 additions and 15 deletions

View File

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