mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-08 03:07:51 +00:00
fix(web): change namespace URL prefix from /@namespace to /space/namespace to avoid route conflicts
This commit is contained in:
parent
e4ae46515e
commit
7f1e9b96fe
8 changed files with 10 additions and 10 deletions
|
|
@ -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,
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export function HomePage() {
|
|||
}
|
||||
|
||||
const handleSkillClick = (namespace: string, slug: string) => {
|
||||
navigate({ to: `/@${namespace}/${slug}` })
|
||||
navigate({ to: `/space/${namespace}/${slug}` })
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue