diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 126579ac4..fd37efcbe 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -180,6 +180,9 @@ func (w WebsiteService) GetWebsites() ([]response.WebsiteDTO, error) { func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) { alias := create.Alias + if alias == "default" { + return buserr.New("ErrDefaultAlias") + } if common.ContainsChinese(alias) { alias, err = common.PunycodeEncode(alias) if err != nil { diff --git a/backend/i18n/lang/en.yaml b/backend/i18n/lang/en.yaml index 869ec111d..536e6344c 100644 --- a/backend/i18n/lang/en.yaml +++ b/backend/i18n/lang/en.yaml @@ -93,6 +93,7 @@ ErrPHPResource: 'The local runtime does not support switching!' ErrPathPermission: 'A folder with non-1000:1000 permissions was detected in the index directory, which may cause an Access denied error when accessing the website. Please click the save button above' ErrDomainIsUsed: "Domain is already used by website {{ .name }}" ErrDomainFormat: "{{ .name }} domain format error" +ErrDefaultAlias: "default is a reserved code name, please use another code name" #ssl ErrSSLCannotDelete: "The certificate {{ .name }} is being used by the website and cannot be removed" diff --git a/backend/i18n/lang/zh-Hant.yaml b/backend/i18n/lang/zh-Hant.yaml index 1a7116c5f..afac7a07f 100644 --- a/backend/i18n/lang/zh-Hant.yaml +++ b/backend/i18n/lang/zh-Hant.yaml @@ -93,6 +93,7 @@ ErrPHPResource: '本地運行環境不支持切換!' ErrPathPermission: 'index 目錄下偵測到非 1000:1000 權限資料夾,可能導致網站存取 Access denied 錯誤,請點擊上方儲存按鈕' ErrDomainIsUsed: "域名已被網站【{{ .name }}】使用" ErrDomainFormat: "{{ .name }} 域名格式不正確" +ErrDefaultAlias: "default 為保留代號,請使用其他代號" #ssl ErrSSLCannotDelete: "{{ .name }} 證書正在被網站使用,無法刪除" diff --git a/backend/i18n/lang/zh.yaml b/backend/i18n/lang/zh.yaml index c0b489cf4..5b72f9dca 100644 --- a/backend/i18n/lang/zh.yaml +++ b/backend/i18n/lang/zh.yaml @@ -93,6 +93,7 @@ ErrPHPResource: '本地运行环境不支持切换!' ErrPathPermission: 'index 目录下检测到非 1000:1000 权限文件夹,可能导致网站访问 Access denied 错误,请点击上方保存按钮' ErrDomainIsUsed: "域名已被网站【{{ .name }}】使用" ErrDomainFormat: "{{ .name }} 域名格式不正确" +ErrDefaultAlias: "default 为保留代号,请使用其他代号" #ssl ErrSSLCannotDelete: "{{ .name }} 证书正在被网站使用,无法删除"