提交 611e825d 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

package server bin

上级 f364e6e1
......@@ -6,6 +6,7 @@ import (
websocketHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/websocket"
serverConfig "github.com/easysoft/zentaoatf/internal/server/config"
"github.com/easysoft/zentaoatf/internal/server/core/web"
httpUtils "github.com/easysoft/zentaoatf/pkg/lib/http"
logUtils "github.com/easysoft/zentaoatf/pkg/lib/log"
"github.com/fatih/color"
"os"
......@@ -58,6 +59,8 @@ func main() {
default:
commConsts.ExecFrom = commConsts.FromClient
serverConfig.CONFIG.Server = httpUtils.AddSepIfNeeded(serverConfig.CONFIG.Server)
webServer := web.Init(serverConfig.CONFIG.Port)
if webServer == nil {
return
......
......@@ -29,7 +29,7 @@ func (s *HeartbeatService) Heartbeat() {
req.Secret = serverConfig.CONFIG.Secret
}
url := zentaoHelper.GenApiUrl("api.php/v1/ztf/heartbeat", nil, serverConfig.CONFIG.Server)
url := zentaoHelper.GenApiUrl("ztf/heartbeat", nil, serverConfig.CONFIG.Server)
respBytes, err := httpUtils.Post(url, req)
ok := err == nil
......@@ -48,8 +48,8 @@ func (s *HeartbeatService) Heartbeat() {
}
if ok {
logUtils.Info(i118Utils.I118Prt.Sprintf("success_to_register", serverConfig.CONFIG.Server))
logUtils.Info(i118Utils.I118Prt.Sprintf("success_to_register", url))
} else {
logUtils.Info(i118Utils.I118Prt.Sprintf("fail_to_register", serverConfig.CONFIG.Server, respBytes))
logUtils.Info(i118Utils.I118Prt.Sprintf("fail_to_register", url, respBytes))
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册