1.0.27 • Published 3 years ago
request-cs v1.0.27
request-cs
服务云-Axios封装库。request中内置了download方法,用于文件下载。
Install
npm install request-cs --save
Usage
1.全部引入
import request from 'request-cs'
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;this.$download
2.按需引入
import { download, request } from 'utils-cs'
1.0.26
3 years ago
1.0.25
3 years ago
1.0.27
3 years ago
1.0.24
3 years ago
1.0.22
3 years ago
1.0.23
3 years ago
1.0.21
3 years ago
1.0.20
3 years ago
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.11
3 years ago
1.0.12
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.10
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago