|
|
|
@ -130,7 +130,7 @@ public class UserServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> imple |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Boolean weChatBinding(String code, HttpServletResponse response,String state) { |
|
|
|
|
|
|
|
|
|
//String md5Code = Md5Util.md5(code);
|
|
|
|
|
String accessTokenUrl = String.format(weChatConfig.getOPEN_ACCESS_TOKEN_URL(),weChatConfig.getOpenAppid(),weChatConfig.getOpenAppsecret(),code); |
|
|
|
|
|
|
|
|
|
//获取access_token
|
|
|
|
@ -139,10 +139,20 @@ public class UserServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> imple |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
String openId = (String) baseMap.get("openid"); |
|
|
|
|
Boolean result = this.getBaseMapper().updateWeChat(Long.parseLong(state), openId); |
|
|
|
|
String md5OpenId = Md5Util.md5(openId); |
|
|
|
|
Integer countWeChatId = this.getBaseMapper().countWeChatId(md5OpenId); |
|
|
|
|
String token = this.getBaseMapper().getTokenByUserId(Long.parseLong(state)); |
|
|
|
|
if (countWeChatId > 0){ |
|
|
|
|
try { |
|
|
|
|
response.sendRedirect("http://www.huorantech.cn/dq/index.html#/workbench-manpower?token="+token+"&message=1"); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Boolean result = this.getBaseMapper().updateWeChat(Long.parseLong(state), md5OpenId); |
|
|
|
|
log.info("绑定成功---------------------------------------"); |
|
|
|
|
if (result){ |
|
|
|
|
String token = this.getBaseMapper().getTokenByUserId(Long.parseLong(state)); |
|
|
|
|
|
|
|
|
|
if (token != null){ |
|
|
|
|
try { |
|
|
|
|
log.info("转发成功---------------------------------------"); |
|
|
|
|