安卓断线重连时刷新页面
This commit is contained in:
parent
5476b2c0cb
commit
6e829b06c6
|
@ -37,7 +37,9 @@ export default defineComponent({
|
||||||
const remote_data_exange_processer = new RemoteDataExangeProcesser(options);
|
const remote_data_exange_processer = new RemoteDataExangeProcesser(options);
|
||||||
remote_data_exange_processer.enable();
|
remote_data_exange_processer.enable();
|
||||||
|
|
||||||
|
let disconnect_flag = false;
|
||||||
EventBus.getInstance().on(EventNamesDefine.CurrentConnectDisconnect, () => {
|
EventBus.getInstance().on(EventNamesDefine.CurrentConnectDisconnect, () => {
|
||||||
|
disconnect_flag = true;
|
||||||
$q.loading.show({
|
$q.loading.show({
|
||||||
html: true,
|
html: true,
|
||||||
message:
|
message:
|
||||||
|
@ -53,6 +55,12 @@ export default defineComponent({
|
||||||
|
|
||||||
EventBus.getInstance().on(EventNamesDefine.CurrentConnectConnected, () => {
|
EventBus.getInstance().on(EventNamesDefine.CurrentConnectConnected, () => {
|
||||||
$q.loading.hide();
|
$q.loading.hide();
|
||||||
|
if (disconnect_flag) {
|
||||||
|
if ($q.platform.is.android && $q.platform.is.capacitor) {
|
||||||
|
window.location.reload();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
new Initializer(options).initialize().then(() => {
|
new Initializer(options).initialize().then(() => {
|
||||||
$store.commit("setInitialized");
|
$store.commit("setInitialized");
|
||||||
|
|
Loading…
Reference in New Issue