Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into dev
| | |
| | | @NotEmpty(message = "需求标签不能为空") |
| | | private String needTags; |
| | | /** |
| | | * 其他需求标签 |
| | | */ |
| | | private String needDataRemark; |
| | | /** |
| | | * 是否删除,1删除(已下载),0未删除(未下载) |
| | | */ |
| | | private Boolean isDel; |
| | |
| | | if (StringUtils.isBlank(userRegVo.getPassword())) { |
| | | defaultPassWord = com.kidgrow.common.utils.RandomValueUtils.getRandom(6); |
| | | sysUser.setPassword(passwordEncoder.encode(defaultPassWord)); |
| | | sysUser.setDefaultAuth(false); |
| | | userRegVo.setPassword(defaultPassWord); |
| | | } else { |
| | | sysUser.setPassword(passwordEncoder.encode(userRegVo.getPassword())); |
| | | sysUser.setDefaultAuth(false); |
| | | } |
| | | sysUser.setNickname(userRegVo.getNickname()); |
| | | sysUser.setSex(userRegVo.getSex()); |
| | |
| | | sysUser.setType(UserType.DOCTOR.name()); |
| | | } |
| | | sysUser.setHAdminUser(false); |
| | | sysUser.setDefaultAuth(false); |
| | | sysUser.setOpenId(userRegVo.getOpenId()); |
| | | sysUser.setDel(false); |
| | | sysUser.setTenantId("hospital"); |
| | |
| | | sysDoctor.setDoctorRankId(userRegVo.getDoctorRankId()); |
| | | sysDoctor.setCreateUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysDoctor.setCreateUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysDoctor.setDoctorState(userRegVo.getDoctorState()); |
| | | if (isReg) { |
| | | sysDoctor.setDoctorState(false); |
| | | } |
| | | else |
| | | { |
| | | sysDoctor.setDoctorState(true); |
| | | } |
| | | sysDoctor.setDoctorTel(userRegVo.getMobile()); |
| | | sysDoctor.setDoctorName(userRegVo.getNickname()); |
| | | sysDoctor.setServerUserId(isReg ? createUserId : sysUserd.getId()); |
| | |
| | | <select id="findDoctorUserAllData" parameterType="long" resultType="com.kidgrow.common.model.DoctorUserAll"> |
| | | SELECT sysuser.id, |
| | | sysdoctor.doctor_name, |
| | | sysdoctor.id doctor_Id, |
| | | sysdoctor.doctor_ccie, |
| | | sysdoctor.doctor_tel, |
| | | sysdoctor.doctor_rank, |
| | |
| | | |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.utils.AesUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.oauth2.common.OAuth2AccessToken; |
| | | import org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Base64; |
| | | import java.util.Enumeration; |
| | | |
| | | /** |
| | |
| | | * @param header header中的参数 |
| | | */ |
| | | public static String[] extractHeaderClient(String header) { |
| | | byte[] base64Client = header.substring(BASIC_.length()).getBytes(StandardCharsets.UTF_8); |
| | | byte[] decoded = Base64.getDecoder().decode(base64Client); |
| | | String clientStr = new String(decoded, StandardCharsets.UTF_8); |
| | | String clientStr = null; |
| | | try{ |
| | | clientStr = AesUtils.desEncrypt(header.substring(BASIC_.length())); |
| | | }catch(Exception w){ |
| | | log.error("Header解密失败", w); |
| | | } |
| | | String[] clientArr = clientStr.split(":"); |
| | | if (clientArr.length != 2) { |
| | | throw new RuntimeException("Invalid basic authentication token"); |
| | |
| | | /** |
| | | * 医生姓名 |
| | | */ |
| | | private Long doctorId; |
| | | /** |
| | | * 医生姓名 |
| | | */ |
| | | private String doctorName; |
| | | /** |
| | | * 医生的头像 |
| | |
| | | |
| | | /** |
| | | * 加密方法 |
| | | * @param data 要加密的数据 |
| | | * @param key 加密key |
| | | * @param iv 加密iv |
| | | * |
| | | * @param data 要加密的数据 |
| | | * @param key 加密key |
| | | * @param iv 加密iv |
| | | * @return 加密的结果 |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 解密方法 |
| | | * |
| | | * @param data 要解密的数据 |
| | | * @param key 解密key |
| | | * @param iv 解密iv |
| | | * @param iv 解密iv |
| | | * @return 解密的结果 |
| | | * @throws Exception |
| | | */ |
| | |
| | | IvParameterSpec ivspec = new IvParameterSpec(iv.getBytes()); |
| | | cipher.init(Cipher.DECRYPT_MODE, keyspec, ivspec); |
| | | byte[] original = cipher.doFinal(encrypted1); |
| | | String originalString = new String(original); |
| | | String originalString = new String(original).trim(); |
| | | return originalString; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | /** |
| | | * 使用默认的key和iv解密 |
| | | * |
| | | * @param data |
| | | * @return |
| | | * @throws Exception |
| | |
| | | /login.html, |
| | | /user/login, |
| | | /api-sms/smsChangLan/send, |
| | | /api-user/users/doctorUserReg |
| | | /api-user/users/doctorUserReg, |
| | | /api-file/files-upload |
| | | # /api-user/syshospital/findAllByMap, |
| | | # /api-user/sysdictionaries/findAll, |
| | | # /api-user/sysdepartment/findListByHospitalId |
| | |
| | | import com.kidgrow.authclient.util.AuthUtils; |
| | | import com.kidgrow.common.constant.SecurityConstants; |
| | | import com.kidgrow.common.context.ClientContextHolder; |
| | | import com.kidgrow.common.utils.AesUtils; |
| | | import com.kidgrow.common.utils.ResponseUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | public void getUserTokenInfo( |
| | | @ApiParam(required = true, name = "username", value = "账号") String username, |
| | | @ApiParam(required = true, name = "password", value = "密码") String password, |
| | | HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password); |
| | | HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | //先解密 |
| | | String decryptName = AesUtils.desEncrypt(username).trim(); |
| | | String decryptPwd = AesUtils.desEncrypt(password).trim(); |
| | | |
| | | UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(decryptName, decryptPwd); |
| | | writerToken(request, response, token, "用户名或密码错误"); |
| | | } |
| | | |