Commit cfdf24cc authored by wxk's avatar wxk

平台配置接口ok

parent eb83ea77
...@@ -6,13 +6,12 @@ const path = require('path') ...@@ -6,13 +6,12 @@ const path = require('path')
module.exports = { module.exports = {
dev: { dev: {
// Paths // Paths
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: '/', assetsPublicPath: '/',
proxyTable: { proxyTable: {
'/asset_monitor': { '/': {
target: 'http://47.91.221.203:46656', // 接口的域名 target: 'http://47.91.221.203:46657', // 接口的域名
// secure: false, // 如果是https接口,需要配置这个参数 // secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置 changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
pathRewrite: { pathRewrite: {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="shortcut icon" media="screen" type="image/x-icon" href="static/robot.ico">
<title>机器人监控</title> <title>机器人监控</title>
</head> </head>
<body> <body>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</el-menu-item> </el-menu-item>
<el-submenu index="1"> <el-submenu index="1">
<template slot="title">网站监控</template> <template slot="title">网站监控</template>
<el-menu-item :index="'/monitor/' + index" v-for="(item, index) in platInfo">{{item.platform}}</el-menu-item> <el-menu-item :index="'/monitor/' + index" v-for="(item, index) in platInfo" :key="item.platform">{{item.platform}}</el-menu-item>
</el-submenu> </el-submenu>
<el-submenu index="2"> <el-submenu index="2">
<template slot="title">币种监控</template> <template slot="title">币种监控</template>
......
const baseUrl = "/asset_monitor";
const Api = { const Api = {
Login: baseUrl + "/login",//登录 Login: "/login",//登录
Register: baseUrl + "/register",//注册 Register: "/register",//注册
ResetPassword: baseUrl + "/resetPassword",//重置密码 ResetPassword: "/resetPassword",//重置密码
SendEmailVcode: baseUrl + "/sendEmailVcode",//发送验证码 SendEmailVcode: "/sendEmailVcode",//发送验证码
GetMatchRobots: baseUrl + "/accountlist",//获取符合条件的机器人 GetMatchRobots: "/accountlist",//获取符合条件的机器人
GetRobotStatus: baseUrl + "/robotStatus",//机器人预警状态查询 GetRobotStatus: "/robotStatus",//机器人预警状态查询
GetPlatformInfo: baseUrl + "/platform",//交易所及匹配的交易对、目标币信息查询 GetPlatformInfo: "/platform",//交易所及匹配的交易对、目标币信息查询
} }
export default Api; export default Api;
...@@ -15,33 +15,47 @@ ...@@ -15,33 +15,47 @@
<script> <script>
import PreHeader from '../components/preHeader' import PreHeader from '../components/preHeader'
import NavLeft from '../components/navLeft' import NavLeft from '../components/navLeft'
import axios from 'axios';
import ApiConfig from "../config/api-config";
export default { export default {
data() { data() {
return { return {
platInfo: [ platInfo: [],
{ // platInfo: [
"platform":"找币", // {
"symbol":["DCR/BTC", "YCC/BTC"], // "platform":"找币",
"coin":["DCR", "BTY"] // "symbol":["DCR/BTC", "YCC/BTC"],
},{ // "coin":["DCR", "BTY"]
"platform":"火币", // },{
"symbol":["DCR/BTC", "BTY/BTC"], // "platform":"火币",
"coin":["DCR", "YCC"] // "symbol":["DCR/BTC", "BTY/BTC"],
},{ // "coin":["DCR", "YCC"]
"platform":"币安", // },{
"symbol":["DCR/BTC", "YCC/BTC", "BTY/USDT"], // "platform":"币安",
"coin":["DCR", "BTC"] // "symbol":["DCR/BTC", "YCC/BTC", "BTY/USDT"],
},{ // "coin":["DCR", "BTC"]
"platform":"Gateio", // },{
"symbol":["DCR/BTC"], // "platform":"Gateio",
"coin":["DCR"] // "symbol":["DCR/BTC"],
} // "coin":["DCR"]
] // }
// ]
} }
}, },
components: { components: {
PreHeader, PreHeader,
NavLeft NavLeft
},
created() {
this.getPlatInfo();
},
methods: {
getPlatInfo() {
axios.post(ApiConfig.GetPlatformInfo).then( res =>{
this.platInfo = res.data.data;
// console.log(this.platInfo)
})
}
} }
} }
</script> </script>
......
...@@ -298,12 +298,10 @@ ...@@ -298,12 +298,10 @@
this.subtitle = '所有机器人'; this.subtitle = '所有机器人';
this.checkAll = false; //交易所筛选 this.checkAll = false; //交易所筛选
this.checkedWebs = []; this.checkedWebs = [];
this.webs = [];
this.isIndeterminate = true; this.isIndeterminate = true;
this.foldExchange = true; this.foldExchange = true;
this.checkAll0 = false; //币种筛选 this.checkAll0 = false; //币种筛选
this.checkedCurrencies = []; this.checkedCurrencies = [];
this.currencies = [];
this.sIndeterminate0 = true; this.sIndeterminate0 = true;
this.foldExchange0 = true; this.foldExchange0 = true;
this.checkAll1 = false; //交易对筛选 this.checkAll1 = false; //交易对筛选
...@@ -321,11 +319,6 @@ ...@@ -321,11 +319,6 @@
}, },
methods: { methods: {
init() { init() {
//获取所有的交易所和币种
for (let item of this.platInfo){
this.webs.push(item.platform);
this.currencies = this.allCurrencies = [...new Set(this.currencies.concat(item.coin))];
}
const RoutePath = this.$route.params.name; const RoutePath = this.$route.params.name;
// console.log(RoutePath); // console.log(RoutePath);
switch (RoutePath) { switch (RoutePath) {
...@@ -444,6 +437,13 @@ ...@@ -444,6 +437,13 @@
watch:{ watch:{
$route(newVal, oldVal){ $route(newVal, oldVal){
// console.log(newVal.params.name) // console.log(newVal.params.name)
},
platInfo(val){
//获取所有的交易所和币种
for (let item of val){
this.webs.push(item.platform);
this.currencies = this.allCurrencies = [...new Set(this.currencies.concat(item.coin))];
}
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment