1.建立axios实例
//lzk 2019-8-29
import service from 'axios'
import {baseUrlTrial} from "../index";
import setRequestHeader from "../setRequestHeader";
import {interceptors} from "../interceptor";
// 创建axios实例
const axios = service.create({
baseURL:baseUrlTrial, // api 的 base_url
// baseURL: "http://10.98.15.90:9110/", // api 的 base_url
timeout: 50000, // 请求超时时间
// contentType: "application/json;charset=utf-8",
// dataType: "json",
...setRequestHeader
});
interceptors(axios);
export default axios
2.引入实例,定义请求方法。
//lzk 2019-8-29
import axios from "./index.js"
import axiosline from "./indexLine.js"
import {createSerialNumber} from "../../utils/random";
//分页
export function getTrailList(obj,objtotal) {
obj.seqno = createSerialNumber()
re