| | |
| | | if (tenant==null){ |
| | | // appUser.setTenantAttributes(); |
| | | // appUser.setTenantType(); |
| | | tenant = new TTenant(); |
| | | tenant.setPhone(appletUserDecodeData.getPhoneNumber()); |
| | | tenant.setAccount(appletUserDecodeData.getPhoneNumber()); |
| | | tenant.setPassword(SecurityUtils.encryptPassword(appletUserDecodeData.getPhoneNumber().substring(5))); |
| | | tenant.setOpenId(appletUserDecodeData.getOpenId()); |
| | | // 手机号中间四位替换为* |
| | | tenant.setResidentName(appletUserDecodeData.getPhoneNumber().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")); |
| | | tTenantService.save(tenant); |
| | | } |
| | | LoginUserApplet loginUserApplet = new LoginUserApplet(); |
| | | TTenantResp tTenantResp = new TTenantResp(); |
| | | BeanUtils.copyProperties(tenant, tTenantResp); |
| | | loginUserApplet.setUser(tTenantResp); |
| | | loginUserApplet.setUserId(Long.valueOf(tenant.getId())); |
| | | loginUserApplet.setUserId(tenant.getId()); |
| | | Map<String, Object> tokenInfos = new HashMap<>(); |
| | | tokenInfos.put("token",tokenService.createTokenApplet(loginUserApplet)); |
| | | tokenInfos.put("info",loginUserApplet); |