feat: 添加版本信息
This commit is contained in:
@@ -24,9 +24,9 @@ func SetupRouter() *gin.Engine {
|
||||
}
|
||||
r := gin.Default()
|
||||
r.Use(cors.New(cors.Config{
|
||||
AllowOrigins: []string{"*://*", "http://localhost:5173"},
|
||||
AllowOrigins: []string{"*.kmux.cn"},
|
||||
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "PATCH"},
|
||||
AllowHeaders: []string{"*", "X-Session-Id"},
|
||||
AllowHeaders: []string{"X-Session-Id"},
|
||||
ExposeHeaders: []string{"Content-Length"},
|
||||
AllowCredentials: true,
|
||||
MaxAge: 12 * time.Hour,
|
||||
@@ -42,11 +42,12 @@ func SetupRouter() *gin.Engine {
|
||||
distHTTP := http.FS(dist)
|
||||
r.StaticFS("/js", http.FS(mustSub(dist, "js")))
|
||||
r.StaticFS("/assets", http.FS(mustSub(dist, "assets")))
|
||||
r.StaticFileFS("/favicon.ico", "favicon.ico", distHTTP)
|
||||
r.StaticFileFS("/favicon.png", "favicon.png", distHTTP)
|
||||
|
||||
api := r.Group("/api")
|
||||
{
|
||||
api.POST("/login", wkHandler.Login)
|
||||
api.Any("/version", handler.Version)
|
||||
v1 := api.Group("/v1")
|
||||
{
|
||||
v1.GET("/host", wkHandler.Host)
|
||||
|
||||
Reference in New Issue
Block a user