| | |
| | | watch: {}, |
| | | mounted() { |
| | | this.init(); |
| | | this.initWebSocket(); |
| | | this.getExchange() |
| | | }, |
| | | methods: { |
| | | async getExchange(){ |
| | | let data = await api.getExchange(); |
| | | if (data.status === 0) { |
| | | // Toast.success(data.msg); |
| | | if(data.data==false){ |
| | | |
| | | }else{ |
| | | this.initWebSocket(); |
| | | } |
| | | } else { |
| | | Toast.fail(data.msg); |
| | | } |
| | | }, |
| | | init() { |
| | | this.pageNum = 1; |
| | | this.stockList = []; |
| | |
| | | initWebSocket() { |
| | | console.log("initWebSocket"); |
| | | this.Trade = new WhrWebSocket({ |
| | | path: `wss://ws.huangzhongzhang.com/websocket-server `, |
| | | path: `wss://ws.jinmanxuan.com/websocket-server `, |
| | | onmessage: this.getTradeMessage |
| | | }); |
| | | |