| | |
| | | |
| | | import com.dy.common.aop.SsoVo; |
| | | import com.dy.common.multiDataSource.DataSourceContext; |
| | | import com.dy.common.util.MD5; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaUser; |
| | | import com.mysql.cj.util.StringUtils; |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | if(vo.orgTag == null || vo.orgTag.trim().length() == 0){ |
| | | return BaseResponseUtils.buildFail("未选择组织单位"); |
| | | } |
| | | //把组织单位标签作为数据源名称 |
| | | DataSourceContext.set(vo.orgTag); |
| | | |
| | | String uuid ; |
| | | BaUser userPo ; |
| | | try { |
| | | //Boolean flag = cacheManager.getCacheNames().isEmpty() ; |
| | | uuid = UUID.randomUUID().toString(); |
| | | if(!StringUtils.isNullOrEmpty(vo.password)){ |
| | | /* |
| | | 如果前端进行了base64加密 |
| | | po.password = new String(Base64.getDecoder().decode(po.password)) ; |
| | | */ |
| | | vo.password = MD5.encrypt(vo.password) ; |
| | | } |
| | | userPo = this.sv.loginWithMapperXml(uuid, vo.phone, vo.password); |
| | | } catch (Exception e) { |
| | | log.error("用户登录异常", e); |
| | |
| | | try { |
| | | //Boolean flag = cacheManager.getCacheNames().isEmpty() ; |
| | | uuid = UUID.randomUUID().toString(); |
| | | if(!StringUtils.isNullOrEmpty(vo.password)){ |
| | | /* |
| | | 如果前端进行了base64加密 |
| | | po.password = new String(Base64.getDecoder().decode(po.password)) ; |
| | | */ |
| | | vo.password = MD5.encrypt(vo.password) ; |
| | | } |
| | | userPo = this.sv.loginWithMapperXml(uuid, vo.phone, vo.password); |
| | | } catch (Exception e) { |
| | | log.error("用户登录异常", e); |