修改数据监听过多的BUG
This commit is contained in:
parent
efc69025c1
commit
7701bc8aa8
|
@ -32,7 +32,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import store from '@/store/'
|
||||||
import {getAction} from '@/api/manage'
|
import {getAction} from '@/api/manage'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -62,7 +62,8 @@
|
||||||
methods: {
|
methods: {
|
||||||
initWebSocket: function () {
|
initWebSocket: function () {
|
||||||
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||||
var url = window._CONFIG['domianURL'].replace("https://","ws://").replace("http://","ws://")+"/websocket/1/data_distribute";
|
var userId = store.getters.userInfo.id;
|
||||||
|
var url = window._CONFIG['domianURL'].replace("https://","ws://").replace("http://","ws://")+"/websocket/"+userId+"/data_distribute";
|
||||||
this.websock = new WebSocket(url);
|
this.websock = new WebSocket(url);
|
||||||
this.websock.onopen = this.websocketonopen;
|
this.websock.onopen = this.websocketonopen;
|
||||||
this.websock.onerror = this.websocketonerror;
|
this.websock.onerror = this.websocketonerror;
|
||||||
|
@ -83,7 +84,7 @@
|
||||||
this.percent = data.currProgress
|
this.percent = data.currProgress
|
||||||
},
|
},
|
||||||
websocketclose: function (e) {
|
websocketclose: function (e) {
|
||||||
console.log("connection closed (" + e.code + ")");
|
console.log("connection closed (" + e + ")");
|
||||||
},
|
},
|
||||||
dataAdd(){
|
dataAdd(){
|
||||||
getAction("/dataSpecial/special").then((res) => {
|
getAction("/dataSpecial/special").then((res) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user