Optimize util structure
This commit is contained in:
13
src/util/route.tsx
Normal file
13
src/util/route.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
export const getRedirectUrl = (path: string, redirectUrl: string): string => {
|
||||
return `${path}?redirect=${encodeURIComponent(redirectUrl)}`
|
||||
}
|
||||
|
||||
export const getFullTitle = (data: _DataNode, preTitle?: string) => {
|
||||
data.fullTitle = `${preTitle ? `${preTitle}-` : ''}${data.title as string}`
|
||||
data.children &&
|
||||
data.children.forEach((value) => {
|
||||
getFullTitle(value, data.fullTitle)
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user