Browse Source

Merge remote-tracking branch 'remotes/origin/dev_bugfix_ljj'

master
jianjun 3 years ago
parent
commit
8188136243
  1. 12
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

12
epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

@ -6,8 +6,10 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.alibaba.fastjson.JSON;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
@ -130,13 +132,13 @@ public class LoginServiceImpl implements LoginService {
}
}
} catch (WxErrorException e) {
log.error("->[getMaOpenId]::error[{}]", "解析微信code失败",e);
log.warn("->[getMaOpenId]::error[{}]", "解析微信code失败",e);
}
if (null == wxMaJscode2SessionResult) {
log.error(String.format("解析微信用户信息失败,app[%s],wxCode[%s],result:[%S]",app,wxCode, JSON.toJSONString(wxMaJscode2SessionResult)));
log.warn(String.format("解析微信用户信息失败,app[%s],wxCode[%s],result:[%S]",app,wxCode, JSON.toJSONString(wxMaJscode2SessionResult)));
throw new RenException("解析微信用户信息失败");
} else if (StringUtils.isBlank(wxMaJscode2SessionResult.getOpenid())) {
log.error(String.format("获取微信openid失败,app[%s],wxCode[%s]",app,wxCode));
log.warn(String.format("获取微信openid失败,app[%s],wxCode[%s]",app,wxCode));
throw new RenException("获取微信openid失败");
}
return wxMaJscode2SessionResult;
@ -366,6 +368,10 @@ public class LoginServiceImpl implements LoginService {
} else {
logger.error(String.format("运营人员%s退出成功,清空菜单和权限redis异常", tokenDto.getUserId()));
}
//如果是工作端退出,删除当前工作人员缓存
if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){
CustomerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(),tokenDto.getUserId());
}
return new Result();
}

Loading…
Cancel
Save