修改数据监听过多的BUG
This commit is contained in:
parent
efc69025c1
commit
7701bc8aa8
|
@ -32,7 +32,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import store from '@/store/'
|
||||
import {getAction} from '@/api/manage'
|
||||
|
||||
export default {
|
||||
|
@ -62,7 +62,8 @@
|
|||
methods: {
|
||||
initWebSocket: function () {
|
||||
// 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.onopen = this.websocketonopen;
|
||||
this.websock.onerror = this.websocketonerror;
|
||||
|
@ -83,7 +84,7 @@
|
|||
this.percent = data.currProgress
|
||||
},
|
||||
websocketclose: function (e) {
|
||||
console.log("connection closed (" + e.code + ")");
|
||||
console.log("connection closed (" + e + ")");
|
||||
},
|
||||
dataAdd(){
|
||||
getAction("/dataSpecial/special").then((res) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user