|
@@ -8,6 +8,7 @@ export class ConnectTaskService {
|
|
|
anchorChannelName?: string;
|
|
|
msChannelName: string = 'user_connect_room'; // 主播在线上报频道
|
|
|
onlineUserList: Array<string> = []; // 在线用户列表
|
|
|
+ isSubscribe: boolean = false;
|
|
|
constructor(private msgSer: MessageService) {}
|
|
|
|
|
|
async init() {
|
|
@@ -16,11 +17,15 @@ export class ConnectTaskService {
|
|
|
await this.anchorOnline();
|
|
|
this.getOnlieUserList(this.msChannelName, 'MESSAGE');
|
|
|
}
|
|
|
+ reset(){
|
|
|
+ this.onlineUserList = [];
|
|
|
+ this.isSubscribe = false;
|
|
|
+ }
|
|
|
/* 主播上线 */
|
|
|
async anchorOnline() {
|
|
|
let profile = JSON.parse(localStorage.getItem('profile') || '');
|
|
|
const uid = Parse.User.current()?.id!;
|
|
|
- if (profile?.identyType == 'anchor') {
|
|
|
+ if (profile?.identyType == 'anchor' && !this.isSubscribe) {
|
|
|
let nowChannes = await this.getWhereNow(uid);
|
|
|
console.log('用户已订阅频道:', nowChannes);
|
|
|
// if (!nowChannes.includes(this.msChannelName)) {
|