content: import React from 'react'
  import {Card, Row, Col, Tag as AntTag} from 'antd';
  import $ from 'jquery';
  import {Link} from 'react-router'
  import {Utils, Constants} from '../lib/common.js'
  
  import {PostList} from '../component/post-list.js'
  
  export class CategoryPostPage extends React.Component {
      constructor(props) {
          super(props);
          this.state = {
              postList: []
          }
      }
  
      // 获取数据
      fetchFn = (categoryId) => {
          $.ajax({
              method: "GET",
              url: Constants.baseCGIUrl + "post/category/" + categoryId,
              dataType: 'jsonp',
              success: function (data) {
                  this.setState({postList: data.resData})
              }.bind(this),
              error: function () {
              }
          });
      };
  
      componentWillReceiveProps = (nextProps)=> {
          this.fetchFn(nextProps.params.categoryId);
      }
  
      componentDidMount() {
          this.fetchFn(this.props.params.categoryId);
      }
  
  
      render() {
          return (
              <PostList postList={this.state.postList}></PostList>
          )
      }
  }
  
  