Skip to content

Commit

Permalink
refactor(router): comment out UI index file check for dynamic routing
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkinStars committed Oct 21, 2024
1 parent 7e4aa98 commit 5fd09d8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions internal/router/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
Expand Down

0 comments on commit 5fd09d8

Please sign in to comment.