|
|
|
@ -8,6 +8,7 @@ import {MessageInterface, MessageUtil} from '../../message/message.service'; |
|
|
|
|
import {NoticeService} from '../notice/notice.service'; |
|
|
|
|
import {TranslateService} from '@ngx-translate/core'; |
|
|
|
|
import {ForumNewResponse} from '../../interface/Response'; |
|
|
|
|
import {AbstractRoute} from '../../AbstractRoute'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 论坛组件 |
|
|
|
@ -57,7 +58,8 @@ export class ForumComponent implements OnInit, MessageInterface { |
|
|
|
|
private forumService: ForumService, |
|
|
|
|
private noticeService: NoticeService, |
|
|
|
|
private messageUtil: MessageUtil, |
|
|
|
|
private translate: TranslateService |
|
|
|
|
private translate: TranslateService, |
|
|
|
|
private abstractRoute: AbstractRoute |
|
|
|
|
) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -129,8 +131,12 @@ export class ForumComponent implements OnInit, MessageInterface { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getAllNotices(); |
|
|
|
|
this.getAllPosts(this.currentPage); |
|
|
|
|
if (this.abstractRoute.isLogin()) { |
|
|
|
|
this.getAllNotices(); |
|
|
|
|
this.getAllPosts(this.currentPage); |
|
|
|
|
} else { |
|
|
|
|
this.router.navigateByUrl('/login'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
prefix(key: string): string { |
|
|
|
|