Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

refactor(router): comment out UI index file check for dynamic routing

LinkinStars5f28f1068fdc
diff --git a/internal/router/ui.go b/internal/router/ui.go
index b959bcd3..b0b8a6d9 100644
--- a/internal/router/ui.go
+++ b/internal/router/ui.go
@@ -153,10 +153,15 @@ func (a *UIRouter) Register(r *gin.Engine, baseURLPath string) {
return
}
- if filePath == UIIndexFilePath {
- c.String(http.StatusNotFound, string(file))
- return
- }
+ // This part is to solve the problem of returning 404 when the access path does not exist.
+ // However, there is no way to check whether the current route exists in the frontend.
+ // We can only hand over the route to the frontend for processing.
+ // And the plugin, frontend routes can now be dynamically registered,
+ // so there's no good way to get all frontend routes
+ //if filePath == UIIndexFilePath {
+ // c.String(http.StatusNotFound, string(file))
+ // return
+ //}
c.String(http.StatusOK, string(file))
})