From 5c0d169a26902cf76031c65897f4aeefb10999e2 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Wed, 28 Oct 2020 22:11:21 +0800 Subject: [PATCH] modify static files path --- cmd/webserver.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/webserver.go b/cmd/webserver.go index c20595d3..24636b17 100644 --- a/cmd/webserver.go +++ b/cmd/webserver.go @@ -83,22 +83,26 @@ func startWebServer(c *cli.Context) error { }) router.StaticFile("robots.txt", filepath.Join(config.StaticRootPath, "robots.txt")) - router.Static("/js", filepath.Join(config.StaticRootPath, "js")) - router.Static("/css", filepath.Join(config.StaticRootPath, "css")) - router.Static("/img", filepath.Join(config.StaticRootPath, "img")) - router.Static("/fonts", filepath.Join(config.StaticRootPath, "fonts")) mobileEntryRoute := router.Group("/mobile") mobileEntryRoute.Use(bindMiddleware(middlewares.ServerSettingsCookie(config))) { mobileEntryRoute.StaticFile("/", filepath.Join(config.StaticRootPath, "mobile.html")) } + router.Static("/mobile/js", filepath.Join(config.StaticRootPath, "js")) + router.Static("/mobile/css", filepath.Join(config.StaticRootPath, "css")) + router.Static("/mobile/img", filepath.Join(config.StaticRootPath, "img")) + router.Static("/mobile/fonts", filepath.Join(config.StaticRootPath, "fonts")) desktopEntryRoute := router.Group("/desktop") desktopEntryRoute.Use(bindMiddleware(middlewares.ServerSettingsCookie(config))) { desktopEntryRoute.StaticFile("/", filepath.Join(config.StaticRootPath, "desktop.html")) } + router.Static("/desktop/js", filepath.Join(config.StaticRootPath, "js")) + router.Static("/desktop/css", filepath.Join(config.StaticRootPath, "css")) + router.Static("/desktop/img", filepath.Join(config.StaticRootPath, "img")) + router.Static("/desktop/fonts", filepath.Join(config.StaticRootPath, "fonts")) apiRoute := router.Group("/api")