| | |
| | | String userId = oauthObj.optString("userid", ""); |
| | | // String sessionKey = oauthObj.optString("session_key"); |
| | | |
| | | logger.info("网页登录:"+oauthObj.toString()); |
| | | logger.info("网页登录获取userId:"+oauthObj); |
| | | |
| | | if (StringUtils.isEmpty(userId)) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"人员没有权限登录"); |
| | |
| | | |
| | | // 查询企业微信员工是否离职 |
| | | WeiXinInfo weiXinInfo = CorpMpUtil.userInfo(userId, sysParameter.getParamValue()); |
| | | logger.info("网页登录,查询企业微信员工是否离职:"+ JSON.toJSONString(weiXinInfo)); |
| | | if (weiXinInfo == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"该员工不存在企业微信"); |
| | | } |
| | | if (weiXinInfo.getStatus() == null){ |
| | | logger.error("网页登录,返回数据"+ JSON.toJSONString(weiXinInfo)); |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"该员工账号异常"); |
| | | } |
| | | if (1 != weiXinInfo.getStatus()){ |
| | |
| | | //String session_key = oauthObj.optString("session_key"); |
| | | String unionid = oauthObj.optString("unionid", ""); |
| | | |
| | | logger.info("企业员工-网页登录(普通小程序):"+oauthObj); |
| | | if(StringUtils.noNull(errcode)){ |
| | | logger.error("企业员工-网页登录(普通小程序):"+oauthObj.toString()); |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"解析code获取用户信息失败"); |
| | | } |
| | | |
| | |
| | | |
| | | //openId转userId |
| | | OpenIdAUserId openIdAUserId = CorpMpUtil.openIdToUserId(openId,sysParameter.getParamValue()); |
| | | logger.info("企业员工-网页登录openId转userId:"+openIdAUserId); |
| | | if(openIdAUserId.getErrcode() != 0){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,openIdAUserId.getErrmsg()); |
| | | } |
| | |
| | | |
| | | // 查询企业微信员工是否离职 |
| | | WeiXinInfo weiXinInfo = CorpMpUtil.userInfo(openIdAUserId.getUserid(), sysParameter.getParamValue()); |
| | | logger.info("企业员工-网页登录查询企业微信员工是否离职:"+JSON.toJSONString(weiXinInfo)); |
| | | if (weiXinInfo == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_TIPS,"该员工不存在企业微信"); |
| | | } |