Merge pull request #19 from fantasticit/feat/share

This commit is contained in:
fantasticit 2022-03-28 23:01:06 +08:00 committed by GitHub
commit e49645ff1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}; };