Update project documentation and improve frontend functionality
- Updated the backend documentation in CONTRIBUTING.md and README.md to reflect changes in application structure and API endpoints. - Enhanced the frontend components in MapView.vue for better handling of context menu actions. - Added new types and interfaces in TypeScript for improved type safety in the frontend. - Introduced new utility classes for managing characters and markers in the map. - Updated .gitignore to include .vscode directory for better development environment management.
This commit is contained in:
41
internal/app/handlers_redirects.go
Normal file
41
internal/app/handlers_redirects.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (a *App) redirectRoot(rw http.ResponseWriter, req *http.Request) {
|
||||
if req.URL.Path != "/" {
|
||||
http.NotFound(rw, req)
|
||||
return
|
||||
}
|
||||
if a.setupRequired() {
|
||||
http.Redirect(rw, req, "/map/setup", http.StatusFound)
|
||||
return
|
||||
}
|
||||
http.Redirect(rw, req, "/map/profile", http.StatusFound)
|
||||
}
|
||||
|
||||
func (a *App) redirectLogin(rw http.ResponseWriter, req *http.Request) {
|
||||
if req.URL.Path != "/login" {
|
||||
http.NotFound(rw, req)
|
||||
return
|
||||
}
|
||||
http.Redirect(rw, req, "/map/login", http.StatusFound)
|
||||
}
|
||||
|
||||
func (a *App) redirectLogout(rw http.ResponseWriter, req *http.Request) {
|
||||
if req.URL.Path != "/logout" {
|
||||
http.NotFound(rw, req)
|
||||
return
|
||||
}
|
||||
s := a.getSession(req)
|
||||
if s != nil {
|
||||
a.deleteSession(s)
|
||||
}
|
||||
http.Redirect(rw, req, "/map/login", http.StatusFound)
|
||||
}
|
||||
|
||||
func (a *App) redirectAdmin(rw http.ResponseWriter, req *http.Request) {
|
||||
http.Redirect(rw, req, "/map/admin", http.StatusFound)
|
||||
}
|
||||
Reference in New Issue
Block a user