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