diff --git a/src/pages/websites/cert/apply.tsx b/src/pages/websites/cert/apply.tsx index 9b309c7..ae591ee 100644 --- a/src/pages/websites/cert/apply.tsx +++ b/src/pages/websites/cert/apply.tsx @@ -408,11 +408,11 @@ const Apply = () => { 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) { + if (status === 5) { message.error(status_txt); } else { message.success(status_txt); - navigate({ to: `/client/cert/management` }); // 确保路径正确 + navigate({ to: `/cert/management` }); // 确保路径正确 } } }, [applyTxtCertificateIsSuccess]); diff --git a/src/service/websites.ts b/src/service/websites.ts index 81ba014..a5db4c1 100644 --- a/src/service/websites.ts +++ b/src/service/websites.ts @@ -16,8 +16,8 @@ const websitesServ = { return request.get("/cert/apply/acme/key"); }, // 申请list - getCertList: async (arams: any) => { - return request.post("/cert/apply/list"); + getCertList: async (params: any) => { + return request.post("/cert/apply/list",params); }, // 证书续签 renewCertificate: async (params: any) => { diff --git a/src/store/websites/cert.ts b/src/store/websites/cert.ts index 682f63e..8dcf4c1 100644 --- a/src/store/websites/cert.ts +++ b/src/store/websites/cert.ts @@ -196,18 +196,22 @@ export const getCertificateLogsAtom = (data: req_CertLogs) => }; }); -export const downloadCertificateAtom = (params: Req_DownloadCert) => - atomWithQuery(() => { - return { - queryKey: ["downloadCertificate", params], - queryFn: async ({ queryKey: [, params] }) => { - return await websitesServ.cert.downloadCertificate(params); - }, - select: (res) => { - return res.data; - }, - }; - }); + +export const downloadCertificateAtom = ( + params: Req_DownloadCert, + enableFetchAtom: boolean +) => { + return atomWithQuery(() => ({ + queryKey: ['downloadCertificate', params], + queryFn: async ({ queryKey: [, params] }) => { + return await websitesServ.cert.downloadCertificate(params); + }, + enabled: enableFetchAtom, // 通过 enableFetchAtom 控制是否启用查询 + })); +}; + + + export const deletesCertificateAtom = (params: Req_DeletesCert) => atomWithQuery(() => { return {