fix pc add #13
This commit is contained in:
@@ -70,6 +70,14 @@ func (s *AddressBookService) UpdateAddressBook(abs []*model.AddressBook, userId
|
|||||||
ab.UserId = userId
|
ab.UserId = userId
|
||||||
if !ok {
|
if !ok {
|
||||||
//添加
|
//添加
|
||||||
|
if ab.Platform == "" || ab.Username == "" || ab.Hostname == "" {
|
||||||
|
peer := AllService.PeerService.FindById(ab.Id)
|
||||||
|
if peer.RowId != 0 {
|
||||||
|
ab.Platform = AllService.AddressBookService.PlatformFromOs(peer.Os)
|
||||||
|
ab.Username = peer.Username
|
||||||
|
ab.Hostname = peer.Hostname
|
||||||
|
}
|
||||||
|
}
|
||||||
tx.Create(ab)
|
tx.Create(ab)
|
||||||
} else {
|
} else {
|
||||||
//更新
|
//更新
|
||||||
|
|||||||
Reference in New Issue
Block a user