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 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); });