fix(web): change namespace URL prefix from /@namespace to /space/namespace to avoid route conflicts

This commit is contained in:
vsxd 2026-03-13 13:59:55 +08:00
parent e4ae46515e
commit 7f1e9b96fe
8 changed files with 10 additions and 10 deletions

View file

@ -96,13 +96,13 @@ const searchRoute = createRoute({
const namespaceRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/$namespace',
path: '/space/$namespace',
component: NamespacePage,
})
const skillDetailRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/$namespace/$slug',
path: '/space/$namespace/$slug',
component: SkillDetailPage,
})

View file

@ -10,7 +10,7 @@ export function MyNamespacesPage() {
const { data: namespaces, isLoading } = useMyNamespaces()
const handleNamespaceClick = (slug: string) => {
navigate({ to: `/@${slug}` })
navigate({ to: `/space/${slug}` })
}
const handleMembersClick = (slug: string, e: React.MouseEvent) => {

View file

@ -9,7 +9,7 @@ export function MySkillsPage() {
const { data: skills, isLoading } = useMySkills()
const handleSkillClick = (namespace: string, slug: string) => {
navigate({ to: `/@${namespace}/${slug}` })
navigate({ to: `/space/${namespace}/${slug}` })
}
if (isLoading) {

View file

@ -32,7 +32,7 @@ export function MyStarsPage() {
<SkillCard
key={skill.id}
skill={skill}
onClick={() => navigate({ to: `/@${skill.namespace}/${skill.slug}` })}
onClick={() => navigate({ to: `/space/${skill.namespace}/${skill.slug}` })}
/>
))}
</div>

View file

@ -23,7 +23,7 @@ export function HomePage() {
}
const handleSkillClick = (namespace: string, slug: string) => {
navigate({ to: `/@${namespace}/${slug}` })
navigate({ to: `/space/${namespace}/${slug}` })
}
return (

View file

@ -7,7 +7,7 @@ import { useNamespaceDetail, useSearchSkills } from '@/shared/hooks/use-skill-qu
export function NamespacePage() {
const navigate = useNavigate()
const { namespace } = useParams({ from: '/$namespace' })
const { namespace } = useParams({ from: '/space/$namespace' })
const { data: namespaceData, isLoading: isLoadingNamespace } = useNamespaceDetail(namespace)
const { data: skillsData, isLoading: isLoadingSkills } = useSearchSkills({
@ -16,7 +16,7 @@ export function NamespacePage() {
})
const handleSkillClick = (slug: string) => {
navigate({ to: `/@${namespace}/${slug}` })
navigate({ to: `/space/${namespace}/${slug}` })
}
if (isLoadingNamespace) {

View file

@ -35,7 +35,7 @@ export function SearchPage() {
}
const handleSkillClick = (namespace: string, slug: string) => {
navigate({ to: `/@${namespace}/${slug}` })
navigate({ to: `/space/${namespace}/${slug}` })
}
const totalPages = data ? Math.ceil(data.total / data.size) : 0

View file

@ -22,7 +22,7 @@ export function SkillDetailPage() {
const navigate = useNavigate()
const location = useRouterState({ select: (s) => s.location })
const queryClient = useQueryClient()
const { namespace, slug } = useParams({ from: '/$namespace/$slug' })
const { namespace, slug } = useParams({ from: '/space/$namespace/$slug' })
const { user, hasRole } = useAuth()
const { data: skill, isLoading: isLoadingSkill } = useSkillDetail(namespace, slug)