feat: custom api key

This commit is contained in:
jialin
2026-04-09 21:27:50 +08:00
committed by jialin
parent b947e3a8b9
commit f04b5cdc27
13 changed files with 174 additions and 19 deletions
@@ -96,6 +96,12 @@ const AddModal: React.FC<AddModalProps> = ({
expires_in: getExpireValue(data.expires_in)
};
const res = await createApisKey({ data: params });
// if custom value
if (data.custom) {
return onOk();
}
setAPIKeyValue(res.value);
setShowKey(true);
};
@@ -107,6 +113,7 @@ const AddModal: React.FC<AddModalProps> = ({
const handleOnOk = async (formdata: FormData) => {
try {
console.log('formdata=========', formdata);
setLoading(true);
const data = {
..._.omit(formdata, ['allowed_type']),
@@ -261,6 +268,9 @@ const AddModal: React.FC<AddModalProps> = ({
form={form}
onFinish={handleOnOk}
preserve={false}
initialValues={{
scope: ['*']
}}
>
{!showKey && (
<APIKeyForm