[bug fix] 调用节点地址不能写死 http,不然https的节点就无法使用控制台了。改为 window.location.protocol//window.location.hostname:window.location.port

This commit is contained in:
luk.lu
2019-01-12 15:39:15 +08:00
parent a17463a87c
commit 57c777e1da
3 changed files with 4 additions and 3 deletions

View File

@@ -2,4 +2,4 @@ import axios from 'axios'
// import app from './app'
// 控制台应当默认访问控制台所在主机(localhost 或者 window.location.hostname)的 TIC后台或者让用户在控制台启动时自己设置一个节点主机。
axios.defaults.baseURL = `http://${window.location.hostname}:8888/api/`
axios.defaults.baseURL = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/api/`