|
@@ -603,20 +603,7 @@ func (s *aidedWebService) DeleteCdnServer(ctx context.Context, cdnWebId int) err
|
|
|
|
|
|
// updateWebsiteProtocolAndCert 更新网站协议和证书
|
|
|
func (s *aidedWebService) updateWebsiteProtocolAndCert(ctx context.Context, req *v1.WebForwardingRequest, oldData *model.WebForwarding, require RequireResponse, formData v1.Website) error {
|
|
|
- // 修改证书
|
|
|
- if oldData.HttpsCert != req.WebForwardingData.HttpsCert || oldData.HttpsKey != req.WebForwardingData.HttpsKey {
|
|
|
- if err := s.sslCert.EditSSLCert(ctx, v1.SSL{
|
|
|
- Name: req.WebForwardingData.Domain,
|
|
|
- CertId: oldData.SslCertId,
|
|
|
- CertData: req.WebForwardingData.HttpsCert,
|
|
|
- KeyData: req.WebForwardingData.HttpsKey,
|
|
|
- CdnUserId: require.CdnUid,
|
|
|
- Domain: req.WebForwardingData.Domain,
|
|
|
- Description: req.WebForwardingData.Comment,
|
|
|
- }); err != nil {
|
|
|
- return fmt.Errorf("修改SSL证书失败: %w", err)
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
// 切换协议
|
|
|
var typeConfig, closeConfig v1.TypeJSON
|