赞
踩
基础axios用法请看axios官网
//依赖于axios对私有ajax进行修改
import Qs from 'qs'
import axios from 'axios'
import router from 'router/index'
import {errorPrompt, loading, closeLoading} from 'util/util'
export const status = {
SUCCESS: '100',
NET_ERR: '101', // 网络连接异常,请稍候再试
BIZ_ERR: '103', // 业务请求异常
NO_AUTH: '104'
}
export function fetch(options) {
return new Promise((resolve, reject) => {
let instance = axios.create({
baseURL: process.env.BASE_API,
timeout: 2000,
headers: {
// "tracecode": window.encodeURIComponent(JSON.stringify({
"ua":"","cv":"20161230","token":"3dwo0onUUsPKVJcP8tk","os":"windows10","app":"kind","ws":"1*1","pkey":"f8caf7d7-a5d4-4710-b06f-28a922b6a467"}))
"tracecode": commonBizHeader(isManager(options)),
'Content-Type': 'application/x-www-form-urlencoded'
},
transformRequest: [
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。