|
@@ -62,6 +62,8 @@ export class WebsocketPhoneService {
|
62
|
62
|
console.log(response)
|
63
|
63
|
if (!this.isHandler && response.status === 408 && sessionStorage.getItem('phoneNumber')) {
|
64
|
64
|
this.reconnect(this.url, this.urlParams);
|
|
65
|
+ }else{
|
|
66
|
+ this.updateProperty(false);
|
65
|
67
|
}
|
66
|
68
|
};
|
67
|
69
|
|
|
@@ -119,4 +121,17 @@ export class WebsocketPhoneService {
|
119
|
121
|
this.ws.close();
|
120
|
122
|
}
|
121
|
123
|
}
|
|
124
|
+
|
|
125
|
+ // 创建一个Subject来发送和接收数据
|
|
126
|
+ private updateData = new Subject<any>();
|
|
127
|
+
|
|
128
|
+ // 提供一个方法来发送数据
|
|
129
|
+ updateProperty(data: any) {
|
|
130
|
+ this.updateData.next(data);
|
|
131
|
+ }
|
|
132
|
+
|
|
133
|
+ // 提供一个方法来订阅数据
|
|
134
|
+ getDataUpdate(): Subject<any> {
|
|
135
|
+ return this.updateData;
|
|
136
|
+ }
|
122
|
137
|
}
|