fix: 去掉Dongle校验

main
huangfeng 9 months ago
parent a0657a059a
commit 433811f731

@ -41,9 +41,9 @@ public class AppLoginController {
@PostMapping(value = "/login", produces = { "application/json;charset=utf-8" })
public Map<String, Object> login(@RequestBody UserDTO user) throws UnknownHostException {
log.info("*************");
if(!busiHomePageService.verifyDongle()){
return ResultUtil.put(Md5Util.DANGLE_CODE_FAIL, "", null);
}
// if(!busiHomePageService.verifyDongle()){
// return ResultUtil.put(Md5Util.DANGLE_CODE_FAIL, "", null);
// }
return loginService.login(user,time);
}
}

@ -182,9 +182,9 @@ public class BusiHomePageController {
@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "warningTime", required = false) String warningTime,
@RequestParam(value = "warningTimeEnd", required = false) String warningTimeEnd) throws UnknownHostException {
if(!busiHomePageService.verifyDongle()){
return ResultUtil.put(Md5Util.DANGLE_CODE_FAIL, "", null);
}
// if(!busiHomePageService.verifyDongle()){
// return ResultUtil.put(Md5Util.DANGLE_CODE_FAIL, "", null);
// }
BusiEqmWarningDto busiEqmWarningDto = new BusiEqmWarningDto();
busiEqmWarningDto.setEqType(eqType);
busiEqmWarningDto.setGzType(gzType);

@ -61,7 +61,7 @@ public interface BusiHomePageService {
PageInfo<BusiHomePageWarningVo> findCurrentWarningBySensorCodeList(BusiEqmWarningDto busiEqmWarningDto);
public boolean verifyDongle() throws UnknownHostException;
// public boolean verifyDongle() throws UnknownHostException;
/**
*

@ -110,8 +110,8 @@ public class BusiHomePageServiceImpl implements BusiHomePageService {
@Autowired
private BusiArresterSensorMapper busiArresterSensorMapper;
@Value("${dangle.dat.path}")
private String danglePath;
// @Value("${dangle.dat.path}")
// private String danglePath;
@Value("${dangle.dat.ip}")
private String ip;
@ -239,37 +239,37 @@ public class BusiHomePageServiceImpl implements BusiHomePageService {
return busiEqmWarningService.findCurrentWarningBySensorCodeList(busiEqmWarningDto);
}
@Override
public boolean verifyDongle() throws UnknownHostException {
String path=danglePath;
File file = new File(path);
List list = new ArrayList();
String sourse="";
if (file.exists()) {
try {
//将文件的每行为一个元素添加到list中
list = Files.readAllLines(file.toPath(), Charset.defaultCharset());
} catch (IOException ex) {
ex.printStackTrace();
}
if (list.isEmpty()){
return false;
}
}else{
return false;
}
for (Object line : list) {
sourse+=line;
}
String sourseNew = Md5Util.md5(Md5Util.DANGLE_CONTENT+ip+mac).toUpperCase();
if(sourse.equals(sourseNew)){
return true;
}else{
return false;
}
}
// @Override
// public boolean verifyDongle() throws UnknownHostException {
// String path=danglePath;
// File file = new File(path);
// List list = new ArrayList();
// String sourse="";
// if (file.exists()) {
// try {
// //将文件的每行为一个元素添加到list中
// list = Files.readAllLines(file.toPath(), Charset.defaultCharset());
// } catch (IOException ex) {
// ex.printStackTrace();
// }
// if (list.isEmpty()){
// return false;
// }
//
// }else{
// return false;
// }
// for (Object line : list) {
// sourse+=line;
// }
// String sourseNew = Md5Util.md5(Md5Util.DANGLE_CONTENT+ip+mac).toUpperCase();
// if(sourse.equals(sourseNew)){
// return true;
// }else{
// return false;
// }
//
// }
@Override
public MeteorologicalVo queryMeteorologicalInfo() {

@ -52,8 +52,8 @@ import com.huatek.torch.util.uuid.Uuid;
@Transactional(rollbackFor = Exception.class)
public class LoginServiceImpl implements LoginService {
@Value("${dangle.dat.path}")
private String danglePath;
// @Value("${dangle.dat.path}")
// private String danglePath;
@Value("${dangle.dat.ip}")
private String ip;
@ -76,9 +76,9 @@ public class LoginServiceImpl implements LoginService {
@Override
public Map<String, Object> login(UserDTO user, long time, String tag, String code, boolean verify) throws Exception{
if(!verifyDongle()){
return ResultUtil.put(Md5Util.DANGLE_CODE_FAIL, "", null);
}
// if(!verifyDongle()){
// return ResultUtil.put(Md5Util.DANGLE_CODE_FAIL, "", null);
// }
ValueOperations<String, String> operations = redisTemplate.opsForValue();
if (verify) {
if (StringUtils.isEmpty(code)) {
@ -137,36 +137,36 @@ public class LoginServiceImpl implements LoginService {
return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", "");
}
public boolean verifyDongle() throws UnknownHostException {
String path=danglePath;
File file = new File(path);
List list = new ArrayList();
String sourse="";
if (file.exists()) {
try {
//将文件的每行为一个元素添加到list中
list = Files.readAllLines(file.toPath(), Charset.defaultCharset());
} catch (IOException ex) {
ex.printStackTrace();
}
if (list.isEmpty()){
return false;
}
}else{
return false;
}
for (Object line : list) {
sourse+=line;
}
String sourseNew =Md5Util.md5(Md5Util.DANGLE_CONTENT+ip+mac).toUpperCase();
if(sourse.equals(sourseNew)){
return true;
}else{
return false;
}
}
// public boolean verifyDongle() throws UnknownHostException {
// String path=danglePath;
// File file = new File(path);
// List list = new ArrayList();
// String sourse="";
// if (file.exists()) {
// try {
// //将文件的每行为一个元素添加到list中
// list = Files.readAllLines(file.toPath(), Charset.defaultCharset());
// } catch (IOException ex) {
// ex.printStackTrace();
// }
// if (list.isEmpty()){
// return false;
// }
//
// }else{
// return false;
// }
// for (Object line : list) {
// sourse+=line;
// }
// String sourseNew =Md5Util.md5(Md5Util.DANGLE_CONTENT+ip+mac).toUpperCase();
// if(sourse.equals(sourseNew)){
// return true;
// }else{
// return false;
// }
//
// }
@Override
public Map<String, Object> changePwd(String token, Map<String, String> map) {
String oldPwd = map.get("oldPwd");

Loading…
Cancel
Save