optimize the logic for showing chat history

This commit is contained in:
RockYang
2023-04-20 11:56:33 +08:00
parent efc1ea5d8b
commit 296d83c3a1
6 changed files with 603 additions and 597 deletions

View File

@@ -86,7 +86,7 @@ func (s *Server) Run(webRoot embed.FS, path string, debug bool) {
engine.Use(AuthorizeMiddleware(s))
engine.Use(Recover)
engine.POST("test", s.TestHandle)
engine.POST("api/test", s.TestHandle)
engine.GET("api/session/get", s.GetSessionHandle)
engine.POST("api/login", s.LoginHandle)
engine.POST("api/logout", s.LogoutHandle)
@@ -116,6 +116,9 @@ func (s *Server) Run(webRoot embed.FS, path string, debug bool) {
if c.Request.URL.Path == "/favicon.ico" {
c.Redirect(http.StatusMovedPermanently, "/chat/"+c.Request.URL.Path)
}
if c.Request.URL.Path == "/" {
c.Redirect(http.StatusMovedPermanently, "/chat")
}
})
// process front-end web static files