mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-15 02:42:01 +08:00
【修复】调整下载的方法
This commit is contained in:
@@ -23,8 +23,8 @@ import type {
|
||||
KeyLengthOption,
|
||||
ValidityUnit
|
||||
} from './types';
|
||||
import { createLeafCert, deleteLeafCert, downloadCaCert } from '@/api/ca';
|
||||
import type { CreateLeafCertParams, DeleteLeafCertParams, DownloadCaCertParams } from '@/types/ca';
|
||||
import { createLeafCert, deleteLeafCert } from '@/api/ca';
|
||||
import type { CreateLeafCertParams, DeleteLeafCertParams } from '@/types/ca';
|
||||
import type { GetLeafCertListParams } from '@/types/ca';
|
||||
|
||||
const { handleError } = useError();
|
||||
@@ -261,11 +261,10 @@ export const useController = () => {
|
||||
// 下载证书
|
||||
const handleDownload = (cert: CertItem) => {
|
||||
try {
|
||||
const downloadUrl = downloadCaCert({
|
||||
id: cert.id.toString(),
|
||||
type: "leaf",
|
||||
} as DownloadCaCertParams);
|
||||
window.open(downloadUrl, "_blank");
|
||||
const link = document.createElement("a");
|
||||
link.href = `/v1/private_ca/download_cert?id=${cert.id.toString()}&type=leaf`;
|
||||
link.target = "_blank";
|
||||
link.click();
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
import { useError } from "@baota/hooks/error";
|
||||
import { useStore } from './useStore';
|
||||
import type { PrivateCaItem } from './types';
|
||||
import { getCaList, downloadCaCert, deleteCa as deleteCaApi, createRootCa, createIntermediateCa } from '@/api/ca';
|
||||
import { getCaList, deleteCa as deleteCaApi, createRootCa, createIntermediateCa } from '@/api/ca';
|
||||
import type { GetCaListParams } from '@/types/ca';
|
||||
import { onMounted } from 'vue';
|
||||
import AddCaModal from './components/AddCaModal';
|
||||
@@ -292,9 +292,10 @@ export const useController = () => {
|
||||
*/
|
||||
const handleDownload = (row: PrivateCaItem) => {
|
||||
try {
|
||||
const downloadUrl = downloadCaCert({ id: row.id.toString(), type: 'ca' });
|
||||
console.log('download_url', downloadUrl);
|
||||
window.open(downloadUrl, '_blank');
|
||||
const link = document.createElement("a");
|
||||
link.href = `/v1/private_ca/download_cert?id=${row.id.toString()}&type=ca`;
|
||||
link.target = "_blank";
|
||||
link.click();
|
||||
} catch (error: any) {
|
||||
handleError(error);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import { clearCookie, clearSession } from "@baota/utils/browser";
|
||||
import { useError } from "@baota/hooks/error";
|
||||
import { $t } from "@locales/index";
|
||||
import { useStore } from "./useStore";
|
||||
import { downloadData } from "@/api/setting";
|
||||
|
||||
import EmailChannelModel from "./components/channel/EmailChannelModel";
|
||||
import FeishuChannelModel from "./components/channel/FeishuChannelModel";
|
||||
@@ -131,13 +130,14 @@ export const useController = () => {
|
||||
*/
|
||||
const handleDownloadData = async () => {
|
||||
try {
|
||||
const url = await downloadData();
|
||||
window.open(url, "_blank");
|
||||
const link = document.createElement("a");
|
||||
link.href = "/v1/setting/download_data";
|
||||
link.target = "_blank";
|
||||
link.click();
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 打开添加邮箱通知渠道弹窗
|
||||
* @function openAddEmailChannelModal
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
deleteReport,
|
||||
addReport,
|
||||
testReport,
|
||||
downloadData,
|
||||
} from '@/api/setting'
|
||||
import type {
|
||||
SaveSettingParams,
|
||||
|
||||
Reference in New Issue
Block a user