调整用户头像展示问题,title遗漏

This commit is contained in:
小海
2020-05-16 23:05:57 +08:00
parent 67c509a245
commit 565fc9f673
5 changed files with 16 additions and 5 deletions

View File

@@ -17,7 +17,10 @@
<button nz-button nzType="primary" (click)="registration()">注册</button>
</div>
<div *ngIf="userInfo" id="info">
<img [src]="userInfo.avatarImgUrl" alt="avatar" id="avatar">
<!-- <img [src]="userInfo.avatarImgUrl" alt="avatar" id="avatar">-->
<nz-avatar [nzSrc]="userInfo.avatarImgUrl" *ngIf="userInfo.avatarImgUrl===noAvatarUrl"></nz-avatar>
<nz-avatar [nzText]="userInfo.displayName" style="background: #f56a00"
*ngIf="userInfo.avatarImgUrl!==noAvatarUrl"></nz-avatar>
<button nz-button nzType="link" class="info-name"
nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomRight" nzTrigger="click">
{{userInfo.displayName}}<i nz-icon nzType="caret-down" nzTheme="outline"></i>

View File

@@ -49,7 +49,7 @@ export class HeaderComponent implements OnInit {
@Output() registrationEvent = new EventEmitter();
size: 'large' | 'default';
currentPath: string;
noAvatarUrl = 'https://cdn.celess.cn/'
public pageList: {
path: string;

View File

@@ -4,6 +4,7 @@ import {ApiService} from '../../../api/api.service';
import {PageList} from '../../../class/HttpReqAndResp';
import {Comment, CommentReq} from '../../../class/Comment';
import {GlobalUserService} from '../../../services/global-user.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'app-admin-comment',
@@ -12,7 +13,9 @@ import {GlobalUserService} from '../../../services/global-user.service';
})
export class AdminCommentComponent implements OnInit {
constructor(private apiService: ApiService, private messageService: NzMessageService, private userService: GlobalUserService) {
constructor(private apiService: ApiService, private messageService: NzMessageService, private userService: GlobalUserService,
private title: Title) {
this.title.setTitle('小海博客 | 评论管理')
this.userService.watchUserInfo({
next: data => {
if (data.result) {

View File

@@ -3,6 +3,7 @@ import {HttpClient} from '@angular/common/http';
import {ApiService} from '../../../api/api.service';
import {GlobalUserService} from '../../../services/global-user.service';
import {User} from '../../../class/User';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'app-admin-dashboard',
@@ -10,7 +11,9 @@ import {User} from '../../../class/User';
styleUrls: ['./admin-dashboard.component.less']
})
export class AdminDashboardComponent implements OnInit {
constructor(private apiService: ApiService, private userService: GlobalUserService, private http: HttpClient) {
constructor(private apiService: ApiService, private userService: GlobalUserService, private http: HttpClient,
private title: Title) {
this.title.setTitle('小海博客 | 后台管理');
this.getUserInfo();
}

View File

@@ -5,6 +5,7 @@ import {ApiService} from '../../../api/api.service';
import {NzMessageService} from 'ng-zorro-antd';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {Observable} from 'rxjs';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'app-admin-link',
@@ -13,7 +14,8 @@ import {Observable} from 'rxjs';
})
export class AdminLinkComponent implements OnInit {
constructor(private apiService: ApiService, private messageService: NzMessageService) {
constructor(private apiService: ApiService, private messageService: NzMessageService, private title: Title) {
this.title.setTitle('小海博客 | 友链管理');
this.formGroup = new FormGroup({
id: new FormControl(null),
name: new FormControl(null, [Validators.required]),