/** * Created by gxl.gao on 2017/10/25. */ import React, { Component } from 'react'; // import PropTypes from 'prop-types' import axios from 'axios'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend } from 'recharts'; import { Spin } from 'antd'; class StatisChart extends Component { static propTypes = {}; constructor(props) { super(props); this.state = { showLoading: true, chartDate: { mockCount: 0, mockDateList: [] } }; } UNSAFE_componentWillMount() { this.getMockData(); } // 获取mock 请求次数信息 async getMockData() { let result = await axios.get('/api/plugin/statismock/get'); if (result.data.errcode === 0) { let mockStatisData = result.data.data; this.setState({ showLoading: false, chartDate: { ...mockStatisData } }); } } render() { const width = 1050; const { mockCount, mockDateList } = this.state.chartDate; return (

mock 接口访问总数为:{mockCount.toLocaleString()}

过去3个月mock接口调用情况
); } } export default StatisChart;