You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2024/10/21 02:58:16 UTC
(incubator-answer) branch test updated: refactor(router): comment out UI index file check for dynamic routing
This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/test by this push:
new 5fd09d87 refactor(router): comment out UI index file check for dynamic routing
5fd09d87 is described below
commit 5fd09d878368edc3b2b020b62e48c417d6948fce
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Mon Oct 21 10:57:36 2024 +0800
refactor(router): comment out UI index file check for dynamic routing
---
internal/router/ui.go | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
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))
})