feat: refs #7925 redirect to not found
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
473b0808e8
commit
17dba2ac99
|
@ -260,9 +260,15 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
});
|
});
|
||||||
const { matched: matches } = router.currentRoute.value;
|
const { matched: matches } = router.currentRoute.value;
|
||||||
const { path } = matches.at(-1);
|
const { path } = matches.at(-1);
|
||||||
|
const rowsNumber = store.data.length;
|
||||||
|
|
||||||
|
if (path.includes(':id') && !rowsNumber)
|
||||||
|
return router.push({
|
||||||
|
name: 'NotFound',
|
||||||
|
});
|
||||||
|
|
||||||
const to =
|
const to =
|
||||||
store?.data?.length === 1
|
rowsNumber === 1
|
||||||
? path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`)
|
? path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`)
|
||||||
: path.replace(/:id.*/, '');
|
: path.replace(/:id.*/, '');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue