Commit 76659a80 by hweeeeeei

修复bug:DeviceToken重复问题

parent 6066a5d3
......@@ -152,14 +152,16 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
// 根据appKey查询appid
ImApplication imApplication = imApplicationService.getOneByAppKey(curentJwtToken.getAppKey());
// client登陆的时候 判断数据库内是否已经存在这个设备token,如果存在就清空旧的
this.removeOldToken(imApplication.getId(), curentJwtToken.getToken());
// 清除旧client的redis缓存
ImClient imClient = this.getOne(new QueryWrapper<ImClient>().lambda()
List<ImClient> list = this.list(new QueryWrapper<ImClient>().lambda()
.eq(ImClient::getFkAppid, imApplication.getId())
.eq(ImClient::getDeviceToken, imClientDevice.getDeviceToken()));
if (imClient != null) {
for (ImClient imClient : list) {
deleteCacheImClient(imClient.getFkAppid(), imClient.getClientId());
// client登陆的时候 判断数据库内是否已经存在这个设备token,如果存在就清空旧的
this.removeOldToken(imApplication.getId(), curentJwtToken.getToken());
}
ImClient client = getCurentClient();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment