发布 0.2.1 并完善工具边界与安全性

This commit is contained in:
mid
2026-08-10 14:49:43 +08:00
parent aca004c513
commit 32b7cc827c
47 changed files with 681 additions and 172 deletions
+4 -4
View File
@@ -15,20 +15,20 @@ const toolRoutes: RouteRecordRaw[] = tools.map((tool) => ({
export const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', redirect: '/tools/ascii-hex' },
{ path: '/', redirect: '/tools/utf8-hex' },
...toolRoutes,
{
path: '/setting',
path: '/tools/setting',
name: 'setting',
component: () => import('@/views/SettingView.vue'),
meta: { title: '工具管理' },
},
{ path: '/:pathMatch(.*)*', redirect: '/tools/ascii-hex' },
{ path: '/:pathMatch(.*)*', redirect: '/tools/utf8-hex' },
],
scrollBehavior: () => ({ top: 0 }),
})
router.beforeEach((to) => {
if (to.meta.toolId && !toolById.has(String(to.meta.toolId))) return '/tools/ascii-hex'
if (to.meta.toolId && !toolById.has(String(to.meta.toolId))) return '/tools/utf8-hex'
return true
})