Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc0a1a04b0 | ||
|
|
19a025e888 |
@@ -57,7 +57,7 @@ func (c networkClient) ClientOfflineNotify() {
|
|||||||
for _, peer := range connectedPeers {
|
for _, peer := range connectedPeers {
|
||||||
var clientName string
|
var clientName string
|
||||||
if !slices.ContainsFunc(clients, func(cli model.Client) bool {
|
if !slices.ContainsFunc(clients, func(cli model.Client) bool {
|
||||||
isExist := peer.PublicKey.String() == jsoniter.Get([]byte(cli.Keys), "PublicKey").ToString()
|
isExist := peer.PublicKey.String() == jsoniter.Get([]byte(cli.Keys), "publicKey").ToString()
|
||||||
if isExist {
|
if isExist {
|
||||||
clientName = cli.Name
|
clientName = cli.Name
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,11 @@ func (c networkClient) ClientOfflineNotify() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 已经离线,发送通知
|
// 已经离线,发送通知
|
||||||
msg := fmt.Sprintf(`[离线通知]\n客户端名称 : %v\n客户端IP : %v\n最后在线时间 : %v
|
msg := fmt.Sprintf(`
|
||||||
|
[离线通知] \n
|
||||||
|
客户端名称 : %v \n
|
||||||
|
客户端IP : %v \n
|
||||||
|
最后在线时间 : %v
|
||||||
`, clientName, ipAllocation, peer.LastHandshakeTime.Format("2006-01-02 15:04:05"))
|
`, clientName, ipAllocation, peer.LastHandshakeTime.Format("2006-01-02 15:04:05"))
|
||||||
err := utils.WechatNotify(code).SendTextMessage(msg)
|
err := utils.WechatNotify(code).SendTextMessage(msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user