fix: 路由地址不强制以斜杠开头
兼容新dashboard路由配置
This commit is contained in:
@@ -135,12 +135,6 @@ const schema: VbenFormSchema[] = [
|
|||||||
.string()
|
.string()
|
||||||
.min(2, $t('ui.formRules.minLength', [$t('system.menu.path'), 2]))
|
.min(2, $t('ui.formRules.minLength', [$t('system.menu.path'), 2]))
|
||||||
.max(100, $t('ui.formRules.maxLength', [$t('system.menu.path'), 100]))
|
.max(100, $t('ui.formRules.maxLength', [$t('system.menu.path'), 100]))
|
||||||
.refine(
|
|
||||||
(value: string) => {
|
|
||||||
return value.startsWith('/');
|
|
||||||
},
|
|
||||||
$t('ui.formRules.startWith', [$t('system.menu.path'), '/']),
|
|
||||||
)
|
|
||||||
.refine(
|
.refine(
|
||||||
async (value: string) => {
|
async (value: string) => {
|
||||||
return !(await isMenuPathExists(value, formData.value?.id));
|
return !(await isMenuPathExists(value, formData.value?.id));
|
||||||
@@ -168,12 +162,6 @@ const schema: VbenFormSchema[] = [
|
|||||||
.string()
|
.string()
|
||||||
.min(2, $t('ui.formRules.minLength', [$t('system.menu.path'), 2]))
|
.min(2, $t('ui.formRules.minLength', [$t('system.menu.path'), 2]))
|
||||||
.max(100, $t('ui.formRules.maxLength', [$t('system.menu.path'), 100]))
|
.max(100, $t('ui.formRules.maxLength', [$t('system.menu.path'), 100]))
|
||||||
.refine(
|
|
||||||
(value: string) => {
|
|
||||||
return value.startsWith('/');
|
|
||||||
},
|
|
||||||
$t('ui.formRules.startWith', [$t('system.menu.path'), '/']),
|
|
||||||
)
|
|
||||||
.refine(async (value: string) => {
|
.refine(async (value: string) => {
|
||||||
return await isMenuPathExists(value, formData.value?.id);
|
return await isMenuPathExists(value, formData.value?.id);
|
||||||
}, $t('system.menu.activePathMustExist'))
|
}, $t('system.menu.activePathMustExist'))
|
||||||
|
|||||||
Reference in New Issue
Block a user