fix: web API 版本号改为动态获取,不再硬编码

This commit is contained in:
ZacharyZcR
2026-06-01 08:34:42 +08:00
parent 37b77f9c86
commit 942f0fa6c3
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -3,8 +3,10 @@
package api
import (
"fmt"
"net/http"
"github.com/shadow1ng/fscan/common"
"github.com/shadow1ng/fscan/web/ws"
)
@@ -49,5 +51,5 @@ func healthCheck(w http.ResponseWriter, r *http.Request) {
// systemInfo 系统信息
func systemInfo(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`{"version":"2.1.4","build":"web"}`))
fmt.Fprintf(w, `{"version":"%s","build":"web"}`, common.GetVersion())
}