接口调整,对接后端部分的v2版本

This commit is contained in:
禾几海
2020-05-27 16:41:06 +08:00
parent deb8646bda
commit dba21730ca
22 changed files with 153 additions and 148 deletions

View File

@@ -10,7 +10,7 @@
</span>
<span *ngIf="showMediaArea" class="badge">
<i nz-icon nzType="user" nzTheme="outline"></i>
<span>{{data.authorName}}</span>
<span>{{data.author.displayName}}</span>
</span>
<span *ngIf="showMediaArea" class="badge">
<i nz-icon nzType="file" nzTheme="outline"></i>
@@ -28,7 +28,7 @@
<div>
<span *ngFor="let tag of data.tags">
<i nz-icon nzType="tag" nzTheme="outline"></i>
<a [routerLink]="'/tags/'+tag">{{tag}}</a>
<a [routerLink]="'/tags/'+tag.name">{{tag.name}}</a>
</span>
</div>
</ng-template>

View File

@@ -22,7 +22,7 @@ export class ArticleDetailCardComponent implements OnInit {
}
if (this.showMediaArea == null) {
// 如果作者名不为空 则显示
this.showMediaArea = this.data.authorName != null;
this.showMediaArea = this.data.author.displayName != null;
}
if (this.showTagArea == null) {
this.showTagArea = this.data.tags != null;

View File

@@ -7,7 +7,7 @@ import {PageList} from '../../class/HttpReqAndResp';
import {ErrDispatch} from '../../class/ErrDispatch';
import {RequestObj} from '../../class/HttpReqAndResp';
import {Router} from '@angular/router';
import {Tag} from '../../class/Tag';
import {Category, Tag} from '../../class/Tag';
import {Title} from '@angular/platform-browser';
@Component({
@@ -36,12 +36,11 @@ export class IndexComponent implements OnInit, ErrDispatch {
desc: string;
articles: PageList<Article>;
tagNameAndNumber: { name: string, size: number }[];
categoryList: Tag[];
categoryList: Category[];
counts: {
articleCount: number,
visitorCount: number,
categoryCount: number,
leaveMsgCount: number,
tagCount: number,
commentCount: number
};
@@ -75,7 +74,7 @@ export class IndexComponent implements OnInit, ErrDispatch {
}
});
this.apiService.categories().subscribe({
next: data => this.categoryList = data.result,
next: data => this.categoryList = data.result.list,
error: err => {
}
});