mirror of
https://github.com/usememos/memos.git
synced 2025-02-20 21:30:55 +01:00
chore: fix resource url
This commit is contained in:
parent
397a7f00ef
commit
e35225ff24
@ -1,11 +1,11 @@
|
||||
import { Resource } from "@/types/proto/api/v2/resource_service";
|
||||
|
||||
export const getResourceUrl = (resource: Resource, withOrigin = true) => {
|
||||
export const getResourceUrl = (resource: Resource) => {
|
||||
if (resource.externalLink) {
|
||||
return resource.externalLink;
|
||||
}
|
||||
|
||||
return `${withOrigin ? window.location.origin : ""}/o/r/${resource.name}`;
|
||||
return `${import.meta.env.VITE_API_BASE_URL || window.location.origin}/o/r/${resource.name}`;
|
||||
};
|
||||
|
||||
export const getResourceType = (resource: Resource) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user