mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
feat(custom-request): add support for API token variable (#5263)
* feat(custom-request): add support for API token variable * perf: improve user experience
This commit is contained in:
parent
3f62c90b3e
commit
152651931f
@ -70,7 +70,7 @@ export function CustomRequestSettingsItem() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
refresh();
|
refresh();
|
||||||
return message.success(t('Saved successfully'));
|
message.success(t('Saved successfully'));
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
@ -43,6 +43,11 @@ export const useCustomRequestVariableOptions = () => {
|
|||||||
title: t('Current time', { ns: 'client' }),
|
title: t('Current time', { ns: 'client' }),
|
||||||
children: null,
|
children: null,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: '$nToken',
|
||||||
|
title: 'API token',
|
||||||
|
children: null,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}, [fields, userFields]);
|
}, [fields, userFields]);
|
||||||
};
|
};
|
||||||
|
@ -143,6 +143,7 @@ export async function send(this: CustomRequestPlugin, ctx: Context, next: Next)
|
|||||||
},
|
},
|
||||||
currentUser,
|
currentUser,
|
||||||
currentTime: new Date().toISOString(),
|
currentTime: new Date().toISOString(),
|
||||||
|
$nToken: ctx.getBearerToken(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const getParsedValue = (value) => {
|
const getParsedValue = (value) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user