Members
(static) default
invokeApi
Methods
(inner) invokeApi(config, tokenStorage, url, optionsopt) → {function}
全局http请求的基于fetch polyfill的whatwg-fetch库; 第二级参数兼容fetch标准,请求参考下面see标示链接
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | 全局请求的配置设置参数 Properties
|
|||||||||||||||||||||||||||||||
tokenStorage |
Object | token的增删改方法 Properties
|
|||||||||||||||||||||||||||||||
url |
String | 请求url[注意把前缀除开] |
|||||||||||||||||||||||||||||||
options |
Object |
<optional> |
对fetch标准options参数进行扩展, 单个请求的参数设置在options上 Properties
|
- Version:
- v0.01
- Source:
- See:
Returns:
- 请求返回处理的promise对象
- Type
- function
(inner) queryParams(url, params) → {String}
计算带参数的url
Parameters:
| Name | Type | Description |
|---|---|---|
url |
String | 处理的url字符串 |
params |
Object | 拼接在url后的参数 |
Returns:
- Type
- String