fix: 修复静态资源路径
This commit is contained in:
@@ -136,6 +136,11 @@ func GetTemplatePath() string {
|
||||
return runPath + "/templates/*"
|
||||
}
|
||||
|
||||
func GetStaticPath() string {
|
||||
|
||||
return runPath + "/static/"
|
||||
}
|
||||
|
||||
func parseRate() {
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -13,9 +13,9 @@ func Start() {
|
||||
|
||||
listen := config.GetListen()
|
||||
r := gin.New()
|
||||
r.Static("/img", "./static/img")
|
||||
r.Static("/css", "./static/css")
|
||||
r.Static("/js", "./static/js")
|
||||
r.Static("/img", config.GetStaticPath()+"img")
|
||||
r.Static("/css", config.GetStaticPath()+"css")
|
||||
r.Static("/js", config.GetStaticPath()+"js")
|
||||
r.LoadHTMLGlob(config.GetTemplatePath())
|
||||
r.Use(gin.LoggerWithWriter(log.GetWriter()), gin.Recovery())
|
||||
r.Use(func(ctx *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user