diff --git a/packages/plugins/@nocobase/plugin-action-custom-request/src/client/components/CustomRequestActionDesigner.tsx b/packages/plugins/@nocobase/plugin-action-custom-request/src/client/components/CustomRequestActionDesigner.tsx index 3631fde67..a860e4ef9 100644 --- a/packages/plugins/@nocobase/plugin-action-custom-request/src/client/components/CustomRequestActionDesigner.tsx +++ b/packages/plugins/@nocobase/plugin-action-custom-request/src/client/components/CustomRequestActionDesigner.tsx @@ -70,7 +70,7 @@ export function CustomRequestSettingsItem() { }, }); refresh(); - return message.success(t('Saved successfully')); + message.success(t('Saved successfully')); }} /> diff --git a/packages/plugins/@nocobase/plugin-action-custom-request/src/client/hooks/useCustomRequestVariableOptions.ts b/packages/plugins/@nocobase/plugin-action-custom-request/src/client/hooks/useCustomRequestVariableOptions.ts index 224b6a2af..5b83940d8 100644 --- a/packages/plugins/@nocobase/plugin-action-custom-request/src/client/hooks/useCustomRequestVariableOptions.ts +++ b/packages/plugins/@nocobase/plugin-action-custom-request/src/client/hooks/useCustomRequestVariableOptions.ts @@ -43,6 +43,11 @@ export const useCustomRequestVariableOptions = () => { title: t('Current time', { ns: 'client' }), children: null, }, + { + name: '$nToken', + title: 'API token', + children: null, + }, ]; }, [fields, userFields]); }; diff --git a/packages/plugins/@nocobase/plugin-action-custom-request/src/server/actions/send.ts b/packages/plugins/@nocobase/plugin-action-custom-request/src/server/actions/send.ts index d0beac5af..ce2eccb56 100644 --- a/packages/plugins/@nocobase/plugin-action-custom-request/src/server/actions/send.ts +++ b/packages/plugins/@nocobase/plugin-action-custom-request/src/server/actions/send.ts @@ -143,6 +143,7 @@ export async function send(this: CustomRequestPlugin, ctx: Context, next: Next) }, currentUser, currentTime: new Date().toISOString(), + $nToken: ctx.getBearerToken(), }; const getParsedValue = (value) => {