mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-11-29 18:58:26 +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();
|
||||
return message.success(t('Saved successfully'));
|
||||
message.success(t('Saved successfully'));
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
|
@ -43,6 +43,11 @@ export const useCustomRequestVariableOptions = () => {
|
||||
title: t('Current time', { ns: 'client' }),
|
||||
children: null,
|
||||
},
|
||||
{
|
||||
name: '$nToken',
|
||||
title: 'API token',
|
||||
children: null,
|
||||
},
|
||||
];
|
||||
}, [fields, userFields]);
|
||||
};
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user