mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
fix: 解决 PHP 模版添加失败的问题 (#3541)
This commit is contained in:
parent
c4b7dd70cb
commit
45a58b3b4b
@ -62,7 +62,7 @@ func (p PHPExtensionsService) List() ([]response.PHPExtensionsDTO, error) {
|
||||
|
||||
func (p PHPExtensionsService) Create(req request.PHPExtensionsCreate) error {
|
||||
exist, _ := phpExtensionsRepo.GetFirst(commonRepo.WithByName(req.Name))
|
||||
if exist.ID == 0 {
|
||||
if exist.ID > 0 {
|
||||
return buserr.New(constant.ErrNameIsExist)
|
||||
}
|
||||
extension := model.PHPExtensions{
|
||||
|
@ -478,7 +478,7 @@ const checkPHPExtensions = (rule, value, callback) => {
|
||||
if (value === '' || typeof value === 'undefined' || value == null) {
|
||||
callback(new Error(i18n.global.t('commons.rule.phpExtension')));
|
||||
} else {
|
||||
const reg = /^[a-z0-9,_]{3,300}$/;
|
||||
const reg = /^[a-z0-9,_]{1,300}$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error(i18n.global.t('commons.rule.phpExtension')));
|
||||
} else {
|
||||
|
@ -54,7 +54,7 @@ const loading = ref(false);
|
||||
const updateID = ref(0);
|
||||
const extensionsForm = ref<FormInstance>();
|
||||
const rules = ref({
|
||||
name: [Rules.requiredInput],
|
||||
name: [Rules.requiredInput, Rules.name],
|
||||
extensions: [Rules.requiredInput, Rules.phpExtensions],
|
||||
});
|
||||
const em = defineEmits(['close']);
|
||||
|
Loading…
Reference in New Issue
Block a user