From 75fb0788e27c686ed27f0182b1c7afaa980031cf Mon Sep 17 00:00:00 2001 From: Nova Date: Mon, 11 Feb 2019 11:00:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86axios=E5=92=8Csocket?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/axios.js | 6 ++---- src/store/modules/chain.js | 2 +- src/views/Chain.vue | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/services/axios.js b/src/services/axios.js index 4b7eba8..767bbed 100644 --- a/src/services/axios.js +++ b/src/services/axios.js @@ -1,9 +1,7 @@ import axios from 'axios' // import app from './app' // let baseURL = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/api/` -// let baseURL = `${window.location.protocol}//${window.location.hostname}:8888/api/` -let baseURL = `http://test-us.bittic.net:8888/api/` -let socketUrl = 'ws://test-us.bittic.net:8888' +let baseURL = `${window.location.protocol}//${window.location.hostname}:8888/api/` + // 控制台应当默认访问控制台所在主机(localhost 或者 window.location.hostname)的 TIC后台,或者让用户在控制台启动时,自己设置一个节点主机。 axios.defaults.baseURL = baseURL -axios.defaults.socketUrl = socketUrl diff --git a/src/store/modules/chain.js b/src/store/modules/chain.js index 347e505..4f294b3 100644 --- a/src/store/modules/chain.js +++ b/src/store/modules/chain.js @@ -8,7 +8,7 @@ export default { headers: [ { text: 'chain.thHeight', value: 'height', align: 'center' }, { text: 'chain.thTimestamp', value: 'timestamp', align: 'center' }, - { text: 'chain.thType', value: 'type', align: 'center' }, + { text: 'chain.thType', value: 'type', align: 'center', sortable: false }, { text: 'chain.thHash', value: 'hash', align: 'center' }, ], itemList: [ diff --git a/src/views/Chain.vue b/src/views/Chain.vue index ead8355..33bd80d 100644 --- a/src/views/Chain.vue +++ b/src/views/Chain.vue @@ -89,10 +89,10 @@ import Vue from 'vue' import store from '../store' import VueSocketio from 'vue-socket.io' import io from 'socket.io-client' -import axios from 'axios' +// import axios from 'axios' const { mapState, mapGetters, mapActions, mapMutations } = createNamespacedHelpers('chain') -const socketUrl = 'ws://test-us.bittic.net:8888' +const socketUrl = 'ws://localhost:8888' Vue.use(VueSocketio, io(socketUrl), store)