mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
fix: web API 版本号改为动态获取,不再硬编码
This commit is contained in:
@@ -70,6 +70,8 @@ var (
|
|||||||
date = "unknown"
|
date = "unknown"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func GetVersion() string { return version }
|
||||||
|
|
||||||
// 运行时数据已迁移到Config对象中,使用GetGlobalConfig()访问
|
// 运行时数据已迁移到Config对象中,使用GetGlobalConfig()访问
|
||||||
|
|
||||||
// Shell状态已迁移到State对象中,使用GetGlobalState()访问
|
// Shell状态已迁移到State对象中,使用GetGlobalState()访问
|
||||||
|
|||||||
+3
-1
@@ -3,8 +3,10 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/shadow1ng/fscan/common"
|
||||||
"github.com/shadow1ng/fscan/web/ws"
|
"github.com/shadow1ng/fscan/web/ws"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -49,5 +51,5 @@ func healthCheck(w http.ResponseWriter, r *http.Request) {
|
|||||||
// systemInfo 系统信息
|
// systemInfo 系统信息
|
||||||
func systemInfo(w http.ResponseWriter, r *http.Request) {
|
func systemInfo(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
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())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user