mirror of
https://github.com/usememos/memos.git
synced 2025-11-07 16:07:35 +08:00
chore: fix resource url
This commit is contained in:
parent
397a7f00ef
commit
e35225ff24
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Reference in a new issue