mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-02 19:58:18 +08:00
Merge branch 'vue3' of https://github.com/WeBankFinTech/fes.js into vue3
This commit is contained in:
commit
3c7222eb5d
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "2.0.0-rc.12",
|
||||
"version": "2.0.0-rc.13",
|
||||
"changelog": {
|
||||
"repo": "WeBankFinTech/fes.js",
|
||||
"cacheDir": ".changelog",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fesjs/plugin-request",
|
||||
"version": "2.0.0-rc.11",
|
||||
"version": "2.0.0-rc.13",
|
||||
"description": "@fesjs/plugin-request",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { isObject } from './helpers';
|
||||
|
||||
export default async (ctx, next) => {
|
||||
const { dataField, response } = ctx;
|
||||
if (response && isObject(response.data) && dataField) {
|
||||
ctx.response._rawData = response.data;
|
||||
ctx.response.data = response.data[dataField];
|
||||
const dataField = ctx.config.dataField ?? ctx.dataField;
|
||||
if (ctx.response && isObject(ctx.response.data) && dataField) {
|
||||
ctx.response._rawData = ctx.response.data;
|
||||
ctx.response.data = ctx.response.data[dataField];
|
||||
}
|
||||
await next();
|
||||
};
|
||||
|
@ -28,7 +28,9 @@ export default {
|
||||
const clickIcon = () => {
|
||||
console.log('click Icon');
|
||||
};
|
||||
const { loading, data } = useRequest('/api');
|
||||
const { loading, data } = useRequest('/api', null, {
|
||||
dataField: false
|
||||
});
|
||||
return {
|
||||
loading,
|
||||
data,
|
||||
|
Loading…
Reference in New Issue
Block a user