Merge pull request #56 from ser163/1.0

docs:  完善文档
This commit is contained in:
harrywan 2021-05-08 20:35:44 +08:00 committed by GitHub
commit 9d99fef0d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -230,12 +230,13 @@ this.FesApi.setImportant({
```js ```js
// 参数支持: function, [function, function] // 参数支持: function, [function, function]
// 请求拦截 // 请求拦截
const eject = api.setReqInterceptor(function (config) { const eject = this.FesApi.setReqInterceptor(function (config) {
// do something // do something
return config
}) })
// 取消请求拦截 // 取消请求拦截
api.ejectReqInterceptor(eject); this.FesApi.ejectReqInterceptor(eject);
``` ```
### setResInterceptor & ejectResInterceptor ### setResInterceptor & ejectResInterceptor
@ -243,14 +244,15 @@ api.ejectReqInterceptor(eject);
```js ```js
// 参数支持: function, [function, function] // 参数支持: function, [function, function]
// 响应拦截 // 响应拦截
const eject = api.setResInterceptor((response) => { const eject = this.FesApi.setResInterceptor((response) => {
// do something // do something
return response
}, (error) => { }, (error) => {
// do somthing for error // do somthing for error
}) })
// 取消响应拦截 // 取消响应拦截
api.ejectResInterceptor(eject); this.FesApi.ejectResInterceptor(eject);
``` ```
## FesFesx ## FesFesx