mirror of
https://github.com/langgenius/dify.git
synced 2026-03-26 16:50:14 +08:00
Frontend: - Migrate deprecated imports: modal→dialog, toast→ui/toast, tooltip→tooltip-plus, portal-to-follow-elem→portal-to-follow-elem-plus, select→ui/select, confirm→alert-dialog - Replace next/* with @/next/* wrapper modules - Convert TypeScript enums to const objects (erasable-syntax-only) - Replace all `any` types with `unknown` or specific types in workflow types - Fix unused vars, react-hooks-extra, react-refresh/only-export-components - Extract InteractionMode to separate module, tool-block commands to commands.ts Backend: - Fix pyrefly errors: type narrowing, null guards, getattr patterns - Remove unused TYPE_CHECKING imports in LLM node - Add ignore_imports entries to .importlinter for dify_graph boundary violations Made-with: Cursor
28 lines
698 B
TypeScript
28 lines
698 B
TypeScript
import { redirect } from '@/next/navigation'
|
|
|
|
type HomePageProps = {
|
|
searchParams: Promise<Record<string, string | string[] | undefined>>
|
|
}
|
|
|
|
const Home = async ({ searchParams }: HomePageProps) => {
|
|
const resolvedSearchParams = await searchParams
|
|
const urlSearchParams = new URLSearchParams()
|
|
|
|
Object.entries(resolvedSearchParams).forEach(([key, value]) => {
|
|
if (value === undefined)
|
|
return
|
|
|
|
if (Array.isArray(value)) {
|
|
value.forEach(item => urlSearchParams.append(key, item))
|
|
return
|
|
}
|
|
|
|
urlSearchParams.set(key, value)
|
|
})
|
|
|
|
const queryString = urlSearchParams.toString()
|
|
redirect(queryString ? `/apps?${queryString}` : '/apps')
|
|
}
|
|
|
|
export default Home
|