Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ca42c72e0f | |||
683e7b2cc3 |
@@ -49,13 +49,14 @@ func (c networkClient) ClientOfflineNotify() error {
|
|||||||
// 查询一下通知配置
|
// 查询一下通知配置
|
||||||
code, err := service.Setting().GetByCode("WECHAT_NOTIFY")
|
code, err := service.Setting().GetByCode("WECHAT_NOTIFY")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Errorf("获取微信通知配置失败: %v", err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ func WechatNotify(setting *model.Setting) wechatNotify {
|
|||||||
Addr: sm["addr"],
|
Addr: sm["addr"],
|
||||||
Path: sm["path"],
|
Path: sm["path"],
|
||||||
Method: sm["method"],
|
Method: sm["method"],
|
||||||
toUserId: sm["toUserId"],
|
toUserId: sm["toUserWxId"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user