View Code? Open in Web Editor
NEW
This project forked from main-voice/jikespace_backend
同济大学2023年春专业方向综合项目(软数方向)
License: MIT License
techwave-backend's Introduction
- 🏫 Currently studying at Tongji University, software engineering
- 🗻 Here is my blog website, where I will share my opinion, reading books, as well as some technical experience
- 📫 Contact with me through my email: [email protected]
- 😉 Enjoy it!
![Baokker's github stats](https://camo.githubusercontent.com/4d8ddede102d105d05ed35ff868af544c1d7b150840b5c7d182137a53b451992/68747470733a2f2f6769746875622d726561646d652d73746174732e76657263656c2e6170702f6170693f757365726e616d653d42616f6b6b6572267468656d653d64726163756c61)
techwave-backend's People
Stargazers
techwave-backend's Issues
![image](https://private-user-images.githubusercontent.com/79294872/245048044-e8a73571-45d9-4092-9bc1-dc31bbb331b8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcxOTg5MjgsIm5iZiI6MTcxNzE5ODYyOCwicGF0aCI6Ii83OTI5NDg3Mi8yNDUwNDgwNDQtZThhNzM1NzEtNDVkOS00MDkyLTliYzEtZGMzMWJiYjMzMWI4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTMxVDIzMzcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM1YTYyMDFiZDgyMjdhYmZjMjFlMWY4ZDhhYjU4MGYxNWQ2NTI5MDczODIyNDY2ZTlhMGE5YTkxZDhmY2E4ZmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JcRiBmAgOD223iGJs5U_Jg6pQktWSO2hsBO60AnTo9A)
在这个页面,拒绝举报的时候出现了报错
系统测试的时候发现的
我们注册时的密码位数规定为8-20位,但是UserService的editPassword方法缺乏对新密码位数的判断,这导致用户随便输入一个与旧密码不同的非空字符串就能通过校验
if (user == null) {
QueryWrapper<User> queryAccountWrapper = new QueryWrapper<>();
queryAccountWrapper.eq("account", accountOrEmail);
user = userMapper.selectOne(queryAccountWrapper);
if (user == null) {
return Result.fail(TCode.ACCOUNT_NOT_EXIST.getCode(), "User does not exist", null);
}
}
boolean matches = passwordEncoder.matches(password, user.getPassword());
if (!matches) {
return Result.fail(TCode.PWD_ERROR.getCode(), TCode.PWD_ERROR.getMsg(), null);
}
在上面的代码中,没有对于密码是否为空的判断,在判断完用户是否存在之后就直接去对密码进行了匹配
UserService的editUserInfo函数,缺少对联系方式phone是否全为数字的判断,导致用户任意输入一个11位的字符串都能校验通过,违反了需求规约中的相关用例描述。
PostService中的getPostData方法在进行集成测试时出现bug,postId为空时报错error,需要进行bug修复。
PostServiceImpl中的publishPost方法出现问题,当sectionId和subsectionId不存在数据库中时,仍然能够保存成功而不是提出输入有误的反馈,需要进行bug修复。
RegisterService中的register方法中的password为空时也能注册成功,而不是提醒参数输入有误,需要进行bug修复。
LoginService中的login方法也有同样bug。