old mode 100644
new mode 100755
| | |
| | | import com.java110.utils.constant.*; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.Base64Convert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | |
| | | } |
| | | JSONObject userinfo_paramObj = JSONObject.parseObject(userinfo_paramOut.getBody()); |
| | | |
| | | //处理昵称有特殊符号导致 入库失败问题 |
| | | userinfo_paramObj.put("nickname", Base64Convert.byteToBase64(userinfo_paramObj.getString("nickname").getBytes())); |
| | | |
| | | int loginFlag = paramIn.getInteger("loginFlag"); |
| | | |
| | | //说明是登录页面,下发code 就可以,不需要下发key 之类 |
| | |
| | | //将openId放到redis 缓存,给前段下发临时票据 |
| | | String code = UUID.randomUUID().toString(); |
| | | CommonCache.setValue(code, openId, expireTime); |
| | | CommonCache.setValue(code+"-nickname", userinfo_paramObj.getString("nickname"), expireTime); |
| | | CommonCache.setValue(code+"-headimgurl", userinfo_paramObj.getString("headimgurl"), expireTime); |
| | | CommonCache.setValue(code + "-nickname", userinfo_paramObj.getString("nickname"), expireTime); |
| | | CommonCache.setValue(code + "-headimgurl", userinfo_paramObj.getString("headimgurl"), expireTime); |
| | | if (errorUrl.indexOf("?") > 0) { |
| | | errorUrl += ("&code=" + code); |
| | | } else { |
| | |
| | | //将openId放到redis 缓存,给前段下发临时票据 |
| | | String code = UUID.randomUUID().toString(); |
| | | CommonCache.setValue(code, openId, expireTime); |
| | | CommonCache.setValue(code+"-nickname", userinfo_paramObj.getString("nickname"), expireTime); |
| | | CommonCache.setValue(code+"-headimgurl", userinfo_paramObj.getString("headimgurl"), expireTime); |
| | | CommonCache.setValue(code + "-nickname", userinfo_paramObj.getString("nickname"), expireTime); |
| | | CommonCache.setValue(code + "-headimgurl", userinfo_paramObj.getString("headimgurl"), expireTime); |
| | | if (errorUrl.indexOf("?") > 0) { |
| | | errorUrl += ("&code=" + code); |
| | | } else { |
| | |
| | | if (StringUtil.isEmpty(tmpUserDto.getKey())) { |
| | | String code = UUID.randomUUID().toString(); |
| | | CommonCache.setValue(code, openId, expireTime); |
| | | CommonCache.setValue(code+"-nickname", userinfo_paramObj.getString("nickname"), expireTime); |
| | | CommonCache.setValue(code+"-headimgurl", userinfo_paramObj.getString("headimgurl"), expireTime); |
| | | CommonCache.setValue(code + "-nickname", userinfo_paramObj.getString("nickname"), expireTime); |
| | | CommonCache.setValue(code + "-headimgurl", userinfo_paramObj.getString("headimgurl"), expireTime); |
| | | if (errorUrl.indexOf("?") > 0) { |
| | | errorUrl += ("&code=" + code); |
| | | } else { |
| | |
| | | String code = paramIn.getString("code"); |
| | | |
| | | String openId = CommonCache.getValue(code); |
| | | String nickname = CommonCache.getValue(code+"-nickname"); |
| | | String headimgurl = CommonCache.getValue(code+"-headimgurl"); |
| | | String nickname = CommonCache.getValue(code + "-nickname"); |
| | | String headimgurl = CommonCache.getValue(code + "-headimgurl"); |
| | | |
| | | if (StringUtil.isEmpty(openId)) { |
| | | responseEntity = new ResponseEntity<>("页面失效,请刷新后重试", HttpStatus.UNAUTHORIZED); |
| | |
| | | JSONObject userOwnerInfo = new JSONObject(); |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setOpenId(openId); |
| | | // ownerAppUserDto.setNickName(StringUtil.encodeEmoji(nickname)); |
| | | ownerAppUserDto.setNickName(nickname); |
| | | ownerAppUserDto.setHeadImgUrl(headimgurl); |
| | | ownerAppUserDto.setAppType(OwnerAppUserDto.APP_TYPE_WECHAT); |
| | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | |
| | | |
| | | } |