docs: update docs:

This commit is contained in:
winixt 2023-12-27 17:51:02 +08:00
parent 9c5283aef0
commit a5cde50a22

View File

@ -23,12 +23,14 @@
```js
import { defineRuntimeConfig } from '@fesjs/fes';
import { isPlainObject } from 'lodash-es';
export default defineRuntimeConfig({
request: {
// API 前缀
baseURL: '',
dataHandler(data, response) {
if (isPlainObject(data)) {
// 处理响应内容异常
if (data.code !== '0') {
if (data.code === '10000')
@ -41,6 +43,8 @@ export default defineRuntimeConfig({
}
// 响应数据格式化
return data?.result ? data.result : data;
}
return data;
},
// http 异常,和插件异常
errorHandler(error) {