待解决
一共提出了两个问题
1)注册页面固定姓名,学号。提交时只是更新用户信息。
2)个人中心页面新增家庭住址,联系方式模块。(由于此项目要求运行环境比较苛刻,前端无法修改,所以只能去修改后端的逻辑,此项无法处理)
项目情况
项目结构
基于vue+springboot
技术栈:springboot,vue2,element-ui,node18.17.0,mysql8.0,mybatis
有个很大的问题,这里前端使用构建后的dist,哪怕电脑上没有相应的环境也可以运行成功,移植性很强。但是对于后续的维护并不友好。
更改注册逻辑
页面情况
原代码注册逻辑
YonghuEntity u = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuzhanghao", yonghu.getYonghuzhanghao()));
if(u!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
yonghu.setId(uId);
yonghuService.insert(yonghu);
return R.ok();
更改后(因为姓名,学号于数据库中固定。所以可以用这两个作为唯一标识码)
YonghuEntity u = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuzhanghao", yonghu.getYonghuzhanghao()).eq("yonghuxingming",yonghu.getYonghuxingming()));
if(u==null) {
return R.error("用户不存在");
}
yonghu.setId(u.getId());
yonghuService.updateById(yonghu);
return R.ok();