mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 01:14:50 +08:00
修复更新cron , fix #32
This commit is contained in:
@@ -13,6 +13,7 @@ const CookieModal = ({
|
||||
handleCancel: (needUpdate?: boolean) => void;
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleOk = async (values: any) => {
|
||||
const cookies = values.value
|
||||
@@ -29,6 +30,7 @@ const CookieModal = ({
|
||||
if (flag) {
|
||||
return;
|
||||
}
|
||||
setLoading(true);
|
||||
const method = cookie ? 'put' : 'post';
|
||||
const payload = cookie ? { value: cookies[0], _id: cookie._id } : cookies;
|
||||
const { code, data } = await request[method](`${config.apiPrefix}cookies`, {
|
||||
@@ -43,6 +45,7 @@ const CookieModal = ({
|
||||
message: data,
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
handleCancel(data);
|
||||
};
|
||||
|
||||
@@ -66,6 +69,7 @@ const CookieModal = ({
|
||||
});
|
||||
}}
|
||||
onCancel={() => handleCancel()}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form
|
||||
|
||||
@@ -14,8 +14,10 @@ const CronModal = ({
|
||||
handleCancel: (needUpdate?: boolean) => void;
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleOk = async (values: any) => {
|
||||
setLoading(true);
|
||||
const method = cron ? 'put' : 'post';
|
||||
const payload = { ...values };
|
||||
if (cron) {
|
||||
@@ -33,6 +35,7 @@ const CronModal = ({
|
||||
message: data,
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
handleCancel(data);
|
||||
};
|
||||
|
||||
@@ -60,6 +63,7 @@ const CronModal = ({
|
||||
});
|
||||
}}
|
||||
onCancel={() => handleCancel()}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form form={form} layout="vertical" name="form_in_modal" preserve={false}>
|
||||
|
||||
Reference in New Issue
Block a user