mirror of https://github.com/fantasticit/think.git
17 lines
499 B
TypeScript
17 lines
499 B
TypeScript
export const buildUrl = (url) => {
|
|
if (typeof window === 'undefined') return url;
|
|
return `${window.location.origin}${url}`;
|
|
};
|
|
|
|
export const getWikiShareURL = (wikiId) => {
|
|
const url = '/share/wiki/' + wikiId;
|
|
if (typeof window === 'undefined') return url;
|
|
return window.location.origin + url;
|
|
};
|
|
|
|
export const getDocumentShareURL = (documentId) => {
|
|
const url = '/share/document/' + documentId;
|
|
if (typeof window === 'undefined') return url;
|
|
return window.location.origin + url;
|
|
};
|