增加 web_base_url 配置, 用于配置 web 后台可置于代理子路径下

This commit is contained in:
涵曦
2019-05-10 16:29:55 +00:00
parent 4b7b2f4c27
commit 383dbd1b7b
21 changed files with 124 additions and 73 deletions

View File

@@ -62,7 +62,7 @@ func (s *WebServer) Start() error {
<-stop
}
beego.BConfig.WebConfig.Session.SessionOn = true
beego.SetStaticPath("/static", filepath.Join(common.GetRunPath(), "web", "static"))
beego.SetStaticPath(beego.AppConfig.String("web_base_url")+"/static", filepath.Join(common.GetRunPath(), "web", "static"))
beego.SetViewsPath(filepath.Join(common.GetRunPath(), "web", "views"))
if l, err := connection.GetWebManagerListener(); err == nil {
beego.InitBeforeHTTPRun()