1.0.0 • Published 2 years ago
request-zzf v1.0.0
request-zzf
服务云-Axios封装库。request中内置了download方法,用于文件下载。
Install
npm install request-zzf --save
Usage
1.全部引入
import request from 'request-zzf'
Vue.use(request,{
namespace: process.env.VUE_APP_NAME, // 命名空间名称
timeout: 10000, // 请求超时限制【默认值:10000】
tokenKey: 'tokenKey', // token的key值,非必填【默认值:AuthAPIToken】
error: Function, // 接口Error
except: Function, // 接口报错回调方法,默认Message提示信息
expire: Function, // token过期回调方法,默认调用Vue.prototype.$logout
proxy: {
proxy: [
'/templateapi', // 表单流程配置
'/fieldserviceapi' // 现场服务交付
],
token: 'AuthAPIToken',
tokenPrefix: '',
tokenInvalid: 401,
msg: 'msg',
code: 'code'
} // 微服务代理配置
})
使用:this.$request
1.0.0
2 years ago