fix: fix share

This commit is contained in:
fantasticit 2022-03-28 23:00:23 +08:00
parent 04122a2d56
commit 6018d2fda9
2 changed files with 4 additions and 4 deletions

View File

@ -4,9 +4,9 @@ export const buildUrl = (url) => {
}; };
export const getWikiShareURL = (wikiId) => { export const getWikiShareURL = (wikiId) => {
return window.location.host + '/share/wiki/' + wikiId; return window.location.origin + '/share/wiki/' + wikiId;
}; };
export const getDocumentShareURL = (documentId) => { export const getDocumentShareURL = (documentId) => {
return window.location.host + '/share/document/' + documentId; return window.location.origin + '/share/document/' + documentId;
}; };

View File

@ -1,4 +1,4 @@
import { IDocument } from '@think/domains'; import { IDocument, IUser, IWiki } from '@think/domains';
import { HttpClient } from './HttpClient'; import { HttpClient } from './HttpClient';
/** /**
@ -19,7 +19,7 @@ export const updateDocumentViews = (id: string) => {
export const getPublicDocumentDetail = ( export const getPublicDocumentDetail = (
id: string, id: string,
data: Partial<Pick<IDocument, 'sharePassword'>> data: Partial<Pick<IDocument, 'sharePassword'>>
): Promise<IDocument> => { ): Promise<IDocument & { createUse: IUser; wiki: IWiki }> => {
return HttpClient.post('/document/public/detail/' + id, data); return HttpClient.post('/document/public/detail/' + id, data);
}; };