change matter share preview and download

This commit is contained in:
seaheart
2023-07-08 18:51:46 +08:00
parent 3a07e6e42b
commit 475fc05e72
3 changed files with 16 additions and 9 deletions
+2 -2
View File
@@ -610,7 +610,7 @@ export default class Matter extends BaseEntity {
shareCode: string,
shareRootUuid: string
): string {
return `${EnvUtil.currentHost()}/api/alien/download/${this.uuid}/${
return `${EnvUtil.currentHost()}/api/share/matter/download/${this.uuid}/${
this.name
}?shareUuid=${shareUuid}&shareCode=${shareCode}&shareRootUuid=${shareRootUuid}`;
}
@@ -620,7 +620,7 @@ export default class Matter extends BaseEntity {
shareCode: string,
shareRootUuid: string
): string {
return `${EnvUtil.currentHost()}/api/alien/preview/${this.uuid}/${
return `${EnvUtil.currentHost()}/api/share/matter/preview/${this.uuid}/${
this.name
}?shareUuid=${shareUuid}&shareCode=${shareCode}&shareRootUuid=${shareRootUuid}`;
}
+4
View File
@@ -44,6 +44,10 @@ export default class User extends BaseEntity {
this.assignEntity('space', Space);
}
hasLogin(): boolean {
return this.role !== UserRole.GUEST;
}
getTAG(): string {
return 'user';
}
+10 -7
View File
@@ -55,12 +55,15 @@ export default class Detail extends TankComponent<IProps, IState> {
componentDidMount(): void {
this.share.uuid = this.props.match.params.uuid;
//如果query中有rootUuid那么就更新.
this.share.rootUuid =
BrowserUtil.getQueryByName('shareRootUuid') || this.share.rootUuid;
this.pager.urlPage = Share.URL_MATTER_PAGE;
this.pager.enableHistory();
this.refresh();
if (this.user.hasLogin()) {
//如果query中有rootUuid那么就更新.
this.share.rootUuid =
BrowserUtil.getQueryByName('shareRootUuid') || this.share.rootUuid;
this.pager.enableHistory();
this.pager.urlPage = Share.URL_MATTER_PAGE;
this.refresh();
}
}
componentWillReceiveProps(nextProps: Readonly<IProps>, nextContext: any) {
@@ -82,7 +85,7 @@ export default class Detail extends TankComponent<IProps, IState> {
this.pager.data = this.share.matters;
}
//刷新面包屑
//刷新面包屑,面包屑依赖于这个接口
this.refreshBreadcrumbs();
this.needShareCode = false;