|
|
@ -27,6 +27,7 @@ import { |
|
|
|
TagOutlined, |
|
|
|
} from "@ant-design/icons"; |
|
|
|
import { useQueryClient } from "@tanstack/react-query"; |
|
|
|
import { useNavigate } from "@tanstack/react-router"; |
|
|
|
const i18nPrefix = "cert.apply"; |
|
|
|
|
|
|
|
const DomainsInput = (props: { domains; setDomains; currentDomainMod; setCurrentDomainMod; currentStep }) => { |
|
|
@ -132,10 +133,16 @@ const StatusTable = (props: { value: string; setCurrentStep; setDns_list }) => { |
|
|
|
setForceUpdate((prev) => prev + 1); |
|
|
|
}; |
|
|
|
|
|
|
|
const { mutate: addCnameFun, isPending: addCnamePending, isSuccess } = useAtomValue(certAddCnameAtom); |
|
|
|
const { |
|
|
|
data: addCnameData, |
|
|
|
mutate: addCnameFun, |
|
|
|
isPending, |
|
|
|
isSuccess: isAddSuccess, |
|
|
|
} = useAtomValue(certAddCnameAtom); |
|
|
|
const handleAddCname = async (info: any) => { |
|
|
|
addCnameFun(info); |
|
|
|
}; |
|
|
|
|
|
|
|
// const {
|
|
|
|
// data: dnsVerifyStatus,
|
|
|
|
// isFetching: isVerifyFetching,
|
|
|
@ -360,6 +367,7 @@ const Apply = () => { |
|
|
|
const { styles } = useStyle(); |
|
|
|
const [form] = Form.useForm(); |
|
|
|
const { |
|
|
|
data: applyTxtCertificateData, |
|
|
|
mutate: applyTxtCertificateFun, |
|
|
|
isPending: applyTxtCertificatePending, |
|
|
|
isSuccess: applyTxtCertificateIsSuccess, |
|
|
@ -379,7 +387,7 @@ const Apply = () => { |
|
|
|
}; |
|
|
|
const applyTxtCertificateClick = () => { |
|
|
|
const data: Req_ApplyTxtCertificate = { |
|
|
|
is_sync: true, |
|
|
|
is_sync: false, |
|
|
|
acme_type: acme_type, |
|
|
|
key_rsa: key_rsa, |
|
|
|
dns_list: dns_list, |
|
|
@ -394,6 +402,21 @@ const Apply = () => { |
|
|
|
form.setFieldsValue({ algorithm: key_rsa }); |
|
|
|
}, [domains, acme_type, key_rsa, form]); |
|
|
|
|
|
|
|
const navigate = useNavigate(); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (applyTxtCertificateIsSuccess) { |
|
|
|
const status = (applyTxtCertificateData as any)?.data?.item[0]?.status || 0; |
|
|
|
const status_txt = (applyTxtCertificateData as any)?.data?.item[0]?.status_txt||""; |
|
|
|
if (status || status === 5) { |
|
|
|
message.error(status_txt); |
|
|
|
} else { |
|
|
|
message.success(status_txt); |
|
|
|
navigate({ to: `/client/cert/management` }); // 确保路径正确
|
|
|
|
} |
|
|
|
} |
|
|
|
}, [applyTxtCertificateIsSuccess]); |
|
|
|
|
|
|
|
return ( |
|
|
|
<ListPageLayout |
|
|
|
childrenClassName={styles.applyContent} |
|
|
|