|
@@ -0,0 +1,21 @@
|
|
|
+package init
|
|
|
+
|
|
|
+import (
|
|
|
+ "time"
|
|
|
+
|
|
|
+ "github.com/go-xweb/httpsession"
|
|
|
+ "github.com/go-xweb/xweb"
|
|
|
+)
|
|
|
+
|
|
|
+func init() {
|
|
|
+ httpsession.IsRedisSessionStore = true
|
|
|
+ xweb.Config.Profiler = true
|
|
|
+ xweb.RootApp().AppConfig.StaticFileVersion = false
|
|
|
+ xweb.RootApp().AppConfig.CheckXsrf = false
|
|
|
+ xweb.RootApp().AppConfig.EnableHttpCache = false
|
|
|
+ xweb.RootApp().AppConfig.Mode = xweb.Product
|
|
|
+ xweb.RootApp().AppConfig.SessionTimeout = 7 * 24 * time.Hour
|
|
|
+ xweb.RootApp().Logger.SetOutputLevel(1) //输出日志,改为4则不输出任何日志
|
|
|
+ xweb.RootApp().AppConfig.StaticDir = "web/staticres"
|
|
|
+ xweb.RootApp().BasePath = "/commercial"
|
|
|
+}
|