mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
Add SSL certificate management to WebUI config
Introduces backend API endpoints and frontend UI for managing SSL certificates, including viewing status, uploading, and deleting cert/key files. Adds a new SSL configuration tab in the dashboard, allowing users to enable HTTPS by providing PEM-formatted certificate and key, with changes taking effect after restart.
This commit is contained in:
@@ -281,6 +281,35 @@ export default class WebUIManager {
|
||||
return data.data;
|
||||
}
|
||||
|
||||
// 获取SSL证书状态
|
||||
public static async getSSLStatus () {
|
||||
const { data } = await serverRequest.get<ServerResponse<{
|
||||
enabled: boolean;
|
||||
certExists: boolean;
|
||||
keyExists: boolean;
|
||||
certContent: string;
|
||||
keyContent: string;
|
||||
}>>('/WebUIConfig/GetSSLStatus');
|
||||
return data.data;
|
||||
}
|
||||
|
||||
// 保存SSL证书
|
||||
public static async saveSSLCert (cert: string, key: string) {
|
||||
const { data } = await serverRequest.post<ServerResponse<{ message: string; }>>(
|
||||
'/WebUIConfig/UploadSSLCert',
|
||||
{ cert, key }
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
// 删除SSL证书
|
||||
public static async deleteSSLCert () {
|
||||
const { data } = await serverRequest.post<ServerResponse<{ message: string; }>>(
|
||||
'/WebUIConfig/DeleteSSLCert'
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
// Passkey相关方法
|
||||
public static async generatePasskeyRegistrationOptions () {
|
||||
const { data } = await serverRequest.post<ServerResponse<any>>(
|
||||
|
||||
Reference in New Issue
Block a user