liuyuqi-cnb 2 months ago
parent
commit
07b2b85cad
3 changed files with 3 additions and 4 deletions
  1. 1 2
      back-go/cmd/filecloud.go
  2. 0 0
      back-go/conf/config.toml
  3. 2 2
      back-go/service/service.go

+ 1 - 2
back-go/cmd/filecloud.go

@@ -8,7 +8,7 @@ import (
 )
 )
 
 
 var (
 var (
-	configPath = flag.String("file", "./config.toml", "config file")
+	configPath = flag.String("file", "./conf/config.toml", "config file")
 )
 )
 
 
 func main() {
 func main() {
@@ -22,7 +22,6 @@ func main() {
 		log.Fatal(err)
 		log.Fatal(err)
 	}
 	}
 
 
-	// 启动 Web 服务(所有路由、静态、API、Swagger 都在 service.Launch 里)
 	service.Launch()
 	service.Launch()
 
 
 	logger.Info("Server started")
 	logger.Info("Server started")

+ 0 - 0
back-go/config.toml → back-go/conf/config.toml


+ 2 - 2
back-go/service/service.go

@@ -61,13 +61,13 @@ func Launch() {
 
 
 	// 前端
 	// 前端
 	if config.WebIndex != "" {
 	if config.WebIndex != "" {
-		app.Use(static.Serve("/", static.LocalFile(config.WebIndex, false)))
+		app.Use(static.Serve("/static", static.LocalFile(config.WebIndex, false)))
 		app.NoRoute(func(ctx *gin.Context) {
 		app.NoRoute(func(ctx *gin.Context) {
 			ctx.File(config.WebIndex + "/index.html")
 			ctx.File(config.WebIndex + "/index.html")
 		})
 		})
 	} else {
 	} else {
 		// 使用内置的 public 目录
 		// 使用内置的 public 目录
-		app.Use(static.Serve("/", static.LocalFile("public", false)))
+		app.Use(static.Serve("/static", static.LocalFile("public", false)))
 		app.NoRoute(func(ctx *gin.Context) {
 		app.NoRoute(func(ctx *gin.Context) {
 			ctx.File("public/index.html")
 			ctx.File("public/index.html")
 		})
 		})