| | |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | if(vo.phone == null || vo.phone.trim().length() == 0){ |
| | | return BaseResponseUtils.buildFail("手机号不能为空"); |
| | | } |
| | | if(!vo.phone.equals("admin")){ |
| | | if(vo.phone.length() != 11){ |
| | | return BaseResponseUtils.buildFail("手机号(长度不是11位)不正确"); |
| | |
| | | } |
| | | //把组织单位标签作为数据源名称 |
| | | DataSourceContext.set(vo.orgTag); |
| | | |
| | | //得到所有用户账号 |
| | | List<String> phones = sv.getPhones(); |
| | | if(!phones.contains(vo.phone)){ |
| | | return BaseResponseUtils.buildFail("账号不存在"); |
| | | } |
| | | |
| | | String uuid ; |
| | | BaUser userPo ; |
| | |
| | | uVo.token = uuid ; |
| | | return BaseResponseUtils.buildSuccess(uVo); |
| | | }else{ |
| | | return BaseResponseUtils.buildFail("登录失败"); |
| | | return BaseResponseUtils.buildFail("密码错误"); |
| | | } |
| | | } |
| | | |