Module: http:invokeApi

全局http请求的基于fetch polyfill的whatwg-fetch库

Parameters:
Name Type Attributes Description
config Object

全局请求的配置设置参数

Properties
Name Type Attributes Default Description
prefixG String

全局设定的请求前缀

versionG Object <optional>
'v1.0.0'

全局默认默认请求版本号

tokenStorage Object

token的增删改方法

Properties
Name Type Description
getToken function

获取授权码相关参数token\refreshToken

setToken function

设置授权码

removeToken function

移除授权码

url String

请求url[注意把前缀除开]

options Object <optional>

对fetch标准options参数进行扩展, 单个请求的参数设置在options上

Properties
Name Type Attributes Default Description
prefix String <optional>

API请求前缀

version String <optional>

API请求版本号

params Object <optional>

url上的query参数

withToken Boolean <optional>
true

是否附带token认证

timeout Number <optional>

超时处理,单位ms;

Version:
  • v0.01
Source:
See:
Returns:
  • 请求返回处理的promise对象
Type
function