[Mod]修复index.html中的地址错误
This commit is contained in:
parent
684cfb7e47
commit
ade399d0e0
@ -41,8 +41,8 @@ def main():
|
|||||||
le.info(u'安全关闭进程')
|
le.info(u'安全关闭进程')
|
||||||
me.exit()
|
me.exit()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
for sig in [signal.SIGINT, signal.SIGHUP, signal.SIGTERM]:
|
for sig in [signal.SIGINT, signal.SIGTERM]:
|
||||||
signal.signal(sig, shutdown)
|
signal.signal(sig, shutdown)
|
||||||
|
|
||||||
# 添加交易接口
|
# 添加交易接口
|
||||||
|
@ -348,7 +348,7 @@
|
|||||||
<!-- 引入组件库 -->
|
<!-- 引入组件库 -->
|
||||||
<script src="https://cdn.bootcss.com/element-ui/2.1.0/index.js"></script>
|
<script src="https://cdn.bootcss.com/element-ui/2.1.0/index.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var socket = io.connect("http://101.37.23.188:5000", { transports: ['websocket'] });
|
var socket = io.connect("http://127.0.0.1:5000", { transports: ['websocket'] });
|
||||||
var _strategy = new Object()
|
var _strategy = new Object()
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
@ -443,7 +443,7 @@ new Vue({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
axios.post("http://101.37.23.188:5000/ctastrategy/" + type,{
|
axios.post("http://127.0.0.1:5000/ctastrategy/" + type,{
|
||||||
name:name,
|
name:name,
|
||||||
token:this.config.token
|
token:this.config.token
|
||||||
})
|
})
|
||||||
@ -465,7 +465,7 @@ new Vue({
|
|||||||
const that = this;
|
const that = this;
|
||||||
let strategy = {};
|
let strategy = {};
|
||||||
that.loading.strategy = true;
|
that.loading.strategy = true;
|
||||||
axios.post('http://101.37.23.188:5000/ctastrategy/load', {
|
axios.post('http://127.0.0.1:5000/ctastrategy/load', {
|
||||||
token: this.config.token
|
token: this.config.token
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@ -485,7 +485,7 @@ new Vue({
|
|||||||
gVar(name) {
|
gVar(name) {
|
||||||
const that = this,
|
const that = this,
|
||||||
_var = new Object();
|
_var = new Object();
|
||||||
axios.get("http://101.37.23.188:5000/ctastrategy/var?name=" + name + "&token=" + this.config.token)
|
axios.get("http://127.0.0.1:5000/ctastrategy/var?name=" + name + "&token=" + this.config.token)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.data.result_code !== "success") {
|
if (res.data.result_code !== "success") {
|
||||||
that.$notify({ title: '警告', message: 'ctastrategy/var接口报错', type: 'warning', duration: 0, });
|
that.$notify({ title: '警告', message: 'ctastrategy/var接口报错', type: 'warning', duration: 0, });
|
||||||
@ -521,7 +521,7 @@ new Vue({
|
|||||||
|
|
||||||
gParams(name) {
|
gParams(name) {
|
||||||
const that = this;
|
const that = this;
|
||||||
axios.get("http://101.37.23.188:5000/ctastrategy/param?name=" + name + "&token=" + this.config.token)
|
axios.get("http://127.0.0.1:5000/ctastrategy/param?name=" + name + "&token=" + this.config.token)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.data.result_code !== "success") {
|
if (res.data.result_code !== "success") {
|
||||||
that.$notify({ title: '警告', message: 'ctastrategy/param接口报错', type: 'warning', duration: 0, });
|
that.$notify({ title: '警告', message: 'ctastrategy/param接口报错', type: 'warning', duration: 0, });
|
||||||
@ -545,7 +545,7 @@ new Vue({
|
|||||||
if (this.config.token !== undefined) {
|
if (this.config.token !== undefined) {
|
||||||
gInfo(apiName, this.config.token)
|
gInfo(apiName, this.config.token)
|
||||||
} else {
|
} else {
|
||||||
axios.get('http://101.37.23.188:5000/token?username=test&password=test', {
|
axios.get('http://127.0.0.1:5000/token?username=test&password=test', {
|
||||||
|
|
||||||
})
|
})
|
||||||
.then(function(res) {
|
.then(function(res) {
|
||||||
@ -562,7 +562,7 @@ new Vue({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gInfo(apiName, token) {
|
function gInfo(apiName, token) {
|
||||||
axios.get("http://101.37.23.188:5000/" + apiName + "?token=" + token)
|
axios.get("http://127.0.0.1:5000/" + apiName + "?token=" + token)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.data.result_code == "success") {
|
if (res.data.result_code == "success") {
|
||||||
that[dataArr] = that[dataArr].concat(res.data.data).reverse()
|
that[dataArr] = that[dataArr].concat(res.data.data).reverse()
|
||||||
@ -578,7 +578,7 @@ new Vue({
|
|||||||
onSubmit(e) {
|
onSubmit(e) {
|
||||||
this.loading.order = true;
|
this.loading.order = true;
|
||||||
const that = this;
|
const that = this;
|
||||||
axios.post('http://101.37.23.188:5000/order', {
|
axios.post('http://127.0.0.1:5000/order', {
|
||||||
vtSymbol: this.form.vtSymbol,
|
vtSymbol: this.form.vtSymbol,
|
||||||
price: this.form.lastPrice,
|
price: this.form.lastPrice,
|
||||||
volume: this.form.volume,
|
volume: this.form.volume,
|
||||||
@ -616,7 +616,7 @@ new Vue({
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.loading.subScribe = true;
|
this.loading.subScribe = true;
|
||||||
axios.post("http://101.37.23.188:5000/tick", {
|
axios.post("http://127.0.0.1:5000/tick", {
|
||||||
vtSymbol: _vtSymbol,
|
vtSymbol: _vtSymbol,
|
||||||
token: this.config.token
|
token: this.config.token
|
||||||
})
|
})
|
||||||
@ -640,7 +640,7 @@ new Vue({
|
|||||||
dOrder(e) {
|
dOrder(e) {
|
||||||
let vtOrderID = e.vtOrderID,
|
let vtOrderID = e.vtOrderID,
|
||||||
that = this;
|
that = this;
|
||||||
axios.delete("http://101.37.23.188:5000/order?vtOrderID=" + vtOrderID + "&token=" + this.config.token)
|
axios.delete("http://127.0.0.1:5000/order?vtOrderID=" + vtOrderID + "&token=" + this.config.token)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.data.result_code == "success") {
|
if (res.data.result_code == "success") {
|
||||||
that.$message({ message: '撤单已提交', type: 'success' });
|
that.$message({ message: '撤单已提交', type: 'success' });
|
||||||
@ -654,7 +654,7 @@ new Vue({
|
|||||||
},
|
},
|
||||||
gToken() {
|
gToken() {
|
||||||
const that = this;
|
const that = this;
|
||||||
axios.get('http://101.37.23.188:5000/token?username=test&password=test')
|
axios.get('http://127.0.0.1:5000/token?username=test&password=test')
|
||||||
.then(function(res) {
|
.then(function(res) {
|
||||||
if (res.status == 200 && res.data.result_code == "success") {
|
if (res.status == 200 && res.data.result_code == "success") {
|
||||||
that.config.token = res.data.data
|
that.config.token = res.data.data
|
||||||
@ -682,7 +682,7 @@ new Vue({
|
|||||||
},
|
},
|
||||||
judgeIfStrategy(){
|
judgeIfStrategy(){
|
||||||
let that = this;
|
let that = this;
|
||||||
axios.get("http://101.37.23.188:5000/ctastrategy/name?token="+this.config.token)
|
axios.get("http://127.0.0.1:5000/ctastrategy/name?token="+this.config.token)
|
||||||
.then(res=>{
|
.then(res=>{
|
||||||
let nameArray = res.data.data;
|
let nameArray = res.data.data;
|
||||||
nameArray.forEach(function(item){
|
nameArray.forEach(function(item){
|
||||||
@ -698,7 +698,7 @@ new Vue({
|
|||||||
gContract(){
|
gContract(){
|
||||||
const that = this;
|
const that = this;
|
||||||
if (that.contract.length == 0) {
|
if (that.contract.length == 0) {
|
||||||
axios.get("http://101.37.23.188:5000/contract?token=" + this.config.token)
|
axios.get("http://127.0.0.1:5000/contract?token=" + this.config.token)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
that.loading.contract = false;
|
that.loading.contract = false;
|
||||||
if (res.data.result_code == "success") {
|
if (res.data.result_code == "success") {
|
||||||
@ -714,7 +714,7 @@ new Vue({
|
|||||||
|
|
||||||
},
|
},
|
||||||
gGateway(token) {
|
gGateway(token) {
|
||||||
axios.post('http://101.37.23.188:5000/gateway', {
|
axios.post('http://127.0.0.1:5000/gateway', {
|
||||||
token: token,
|
token: token,
|
||||||
gatewayName: 'CTP'
|
gatewayName: 'CTP'
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user