diff --git a/backend/app/service/website.go b/backend/app/service/website.go index e4991547c..ee9b86dbc 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -704,7 +704,7 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH privateKeyCertBlock, _ := pem.Decode([]byte(privateKey)) if privateKeyCertBlock == nil { - return nil, buserr.New("ErrSSLCertificateFormat") + return nil, buserr.New("ErrSSLKeyFormat") } certBlock, _ := pem.Decode([]byte(certificate)) diff --git a/backend/i18n/lang/en.yaml b/backend/i18n/lang/en.yaml index b0e365578..72898bfa0 100644 --- a/backend/i18n/lang/en.yaml +++ b/backend/i18n/lang/en.yaml @@ -67,7 +67,7 @@ ErrSSLApply: "The certificate continues to be signed successfully, but openresty ErrEmailIsExist: 'Email is already exist' ErrSSLKeyNotFound: 'The private key file does not exist' ErrSSLCertificateNotFound: 'The certificate file does not exist' -ErrSSLKeyFormat: 'Private key file format error, please use pem format' +ErrSSLKeyFormat: 'Private key file verification error' ErrSSLCertificateFormat: 'Certificate file format error, please use pem format' #mysql diff --git a/backend/i18n/lang/zh-Hant.yaml b/backend/i18n/lang/zh-Hant.yaml index bb158b8ea..d563e0e84 100644 --- a/backend/i18n/lang/zh-Hant.yaml +++ b/backend/i18n/lang/zh-Hant.yaml @@ -67,7 +67,7 @@ ErrSSLApply: "證書續簽成功,openresty reload失敗,請檢查配置!" ErrEmailIsExist: '郵箱已存在' ErrSSLKeyNotFound: '私鑰文件不存在' ErrSSLCertificateNotFound: '證書文件不存在' -ErrSSLKeyFormat: '私鑰文件格式錯誤,請使用 pem 格式' +ErrSSLKeyFormat: '私鑰文件校驗錯誤' ErrSSLCertificateFormat: '證書文件格式錯誤,請使用 pem 格式' #mysql diff --git a/backend/i18n/lang/zh.yaml b/backend/i18n/lang/zh.yaml index f6e68bce0..7e66b05de 100644 --- a/backend/i18n/lang/zh.yaml +++ b/backend/i18n/lang/zh.yaml @@ -67,7 +67,7 @@ ErrSSLApply: "证书续签成功,openresty reload失败,请检查配置!" ErrEmailIsExist: '邮箱已存在' ErrSSLKeyNotFound: '私钥文件不存在' ErrSSLCertificateNotFound: '证书文件不存在' -ErrSSLKeyFormat: '私钥文件格式错误,请使用 pem 格式' +ErrSSLKeyFormat: '私钥文件校验失败' ErrSSLCertificateFormat: '证书文件格式错误,请使用 pem 格式' #mysql diff --git a/frontend/src/global/form-rules.ts b/frontend/src/global/form-rules.ts index be3886e49..9cf1a77ed 100644 --- a/frontend/src/global/form-rules.ts +++ b/frontend/src/global/form-rules.ts @@ -96,7 +96,7 @@ const checkName = (rule: any, value: any, callback: any) => { if (value === '' || typeof value === 'undefined' || value == null) { callback(new Error(i18n.global.t('commons.rule.commonName'))); } else { - const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{1,29}$/; + const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,29}$/; if (!reg.test(value) && value !== '') { callback(new Error(i18n.global.t('commons.rule.commonName'))); } else {