feat: 首次安装启动记录到文件做唯一身份

This commit is contained in:
TsMask committed 2024-04-19 19:57:10 +08:00
1 parent ed94c373ff
commit 1f520d95e3
2 files changed
+167 -1

No files matched your search

+5 -1
View File
@@ -8,6 +8,7 @@ import (
"be.ems/src/framework/errorcatch"
"be.ems/src/framework/middleware"
"be.ems/src/framework/middleware/security"
"be.ems/src/framework/utils/machine"
"be.ems/src/modules/chart"
"be.ems/src/modules/common"
"be.ems/src/modules/crontask"
@@ -37,6 +38,9 @@ func AppEngine() *gin.Engine {
// 设置程序内全局资源访问
config.SetAssetsDirFS(assetsDir)
// 首次安装启动记录
machine.Launch()
// 读取服务配置
app.ForwardedByClientIP = config.Get("server.proxy").(bool)
return app
@@ -108,7 +112,7 @@ func initDefeat(app *gin.Engine) {
app.NoRoute(func(c *gin.Context) {
c.JSON(404, gin.H{
"code": 404,
"msg": fmt.Sprintf("%s Not Found", c.Request.RequestURI),
"msg": fmt.Sprintf("Not Found %s", c.Request.RequestURI),
})
})
}