Axios文件
import Axios from \'axios\'Axios.defaults.baseURL = \'http://101.200.243.213:8767\'export default Axios
api —> Order
export class Order {getOrder=\'/order/DealSelectUserOrder\'selectOrder=\'/order/DealSelectOrderBy\'OrderDetail=\'/order/OrderInfo\'AddLogistics=\'/order/DealAddLogistics\'}
使用时:
import Axios from \"../../Axios\";import Api from \'../../api/Index\'
search=(page)=>{Axios.post(Api.order.selectOrder,{page:this.state.pageSize,pageSize:page,order_deaId:this.props.user.user.role_id,order_goodsName:this.refs.title.state.value,order_creteTime:this.state.dateString,order_logisticsStatus:this.state.SearchSelectData}).then((response)=>{if (response.data.code==-1){this.setState({data:[],total:\'\'})}else {let data = response.data.data.map((item)=>{item[\"key\"] = item.order_number;return item;});this.setState({data:data,total:response.data.count})}})}