From db0b5d7050cbd101a6c42a411787e84e7d3c7300 Mon Sep 17 00:00:00 2001 From: zhengpengju Date: Mon, 18 May 2020 14:06:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A6=81=E7=94=A8loading=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: d5e208cfa1ad9760fe4bdfdbaea5059948190ce8 --- projects/WebSPA/wwwroot/js/app.js | 5 ++++- projects/WebSPA/wwwroot/js/message.js | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/projects/WebSPA/wwwroot/js/app.js b/projects/WebSPA/wwwroot/js/app.js index e5d92483..d8f7092d 100644 --- a/projects/WebSPA/wwwroot/js/app.js +++ b/projects/WebSPA/wwwroot/js/app.js @@ -27,7 +27,7 @@ axios.interceptors.request.use( }else{ config.url += `?v=${version}` } - $('#loading').show(); + // $('#loading').show(); return config; }, function (error) { @@ -291,6 +291,9 @@ const app = new Vue({ // router.push({path:'/pages/login'}) } + }, + destroyed: function(){ + alert('des'); }, methods: { }, diff --git a/projects/WebSPA/wwwroot/js/message.js b/projects/WebSPA/wwwroot/js/message.js index c9a463f9..e9281d2f 100644 --- a/projects/WebSPA/wwwroot/js/message.js +++ b/projects/WebSPA/wwwroot/js/message.js @@ -1,5 +1,5 @@ var hubUrl = config.hubUrl; -var connection = new signalR.HubConnectionBuilder().withUrl(hubUrl).withAutomaticReconnect().build(); +var connection = new signalR.HubConnectionBuilder().withUrl(hubUrl).build(); var connectionId; function connect() { @@ -8,11 +8,14 @@ function connect() { console.log('signalR 连接成功'); }).catch(function (err) { console.log(err); - setTimeout(connect, 15 * 1000); + setTimeout(connect, 5000); }); } } -connection.on('Connected', function (id) { +connection.onclose(function () { + console.log('connect closed'); + connect(); +});connection.on('Connected', function (id) { connectionId = id; console.log('signalR 连接Id:' + connectionId); }); From 512b7c3d0792812f42801ce3a5f719eeb4c028ee Mon Sep 17 00:00:00 2001 From: zhengpengju Date: Mon, 18 May 2020 14:18:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 5cb955c406c20246ce64b3fa4216281b5c85b041 --- projects/WebSPA/wwwroot/index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/projects/WebSPA/wwwroot/index.html b/projects/WebSPA/wwwroot/index.html index 3aef902d..7bb82798 100644 --- a/projects/WebSPA/wwwroot/index.html +++ b/projects/WebSPA/wwwroot/index.html @@ -24,9 +24,9 @@ - + @@ -39,10 +39,10 @@ - - - - - + + + + + \ No newline at end of file