Optimize util structure

This commit is contained in:
2023-11-30 13:57:45 +08:00
parent bf8f915b15
commit f595cb380a
19 changed files with 285 additions and 285 deletions

13
src/util/route.tsx Normal file
View 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
}