当前位置: 首页 > news >正文

SpringBoot+Vue在线考试系统源码+论文

代码可以查看文章末尾⬇️联系方式获取,记得注明来意哦~🌹
分享万套开题报告+任务书+答辩PPT模板
作者完整代码目录供你选择:
《SpringBoot网站项目》1800套
《SSM网站项目》1500套
《小程序项目》1600套
《APP项目》1500套
《Python网站项目》1300套
⬇️文章末尾可以获取联系方式,需要源码或者演示视频可以联系⬇️
⚡感兴趣大家可以点点关注收藏,后续更新更多项目资料。⚡

采用技术:

编程语言:Java
后端框架:SpringBoot
前端框架:Vue
数据库:MySQL
数据表数量:8张表
运行软件:IDEA、Eclipse、VS Code都可以

系统功能:


本系统实现管理员、学生模块。
管理员模块功能:管理员、学生、试题管理、试卷管理、试卷列表、考试记录、错题本等。
学生模块功能:试卷列表、考试记录、错题本等。

运行截图:
















论文目录:




核心代码:

packagecom.controller;importjava.text.SimpleDateFormat;importcom.alibaba.fastjson.JSONObject;importjava.util.*;importorg.springframework.beans.BeanUtils;importjavax.servlet.http.HttpServletRequest;importorg.springframework.web.context.ContextLoader;importjavax.servlet.ServletContext;importcom.service.TokenService;importcom.utils.StringUtil;importjava.lang.reflect.InvocationTargetException;importcom.service.DictionaryService;importorg.apache.commons.lang3.StringUtils;importcom.annotation.IgnoreAuth;importorg.slf4j.Logger;importorg.slf4j.LoggerFactory;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.stereotype.Controller;importorg.springframework.web.bind.annotation.*;importcom.baomidou.mybatisplus.mapper.EntityWrapper;importcom.baomidou.mybatisplus.mapper.Wrapper;importcom.entity.YonghuEntity;importcom.service.YonghuService;importcom.entity.view.YonghuView;importcom.utils.PageUtils;importcom.utils.R;@RestController@Controller@RequestMapping("/yonghu")publicclassYonghuController{privatestaticfinalLoggerlogger=LoggerFactory.getLogger(YonghuController.class);@AutowiredprivateYonghuServiceyonghuService;@AutowiredprivateTokenServicetokenService;@AutowiredprivateDictionaryServicedictionaryService;//级联表service/** * 后端列表 */@RequestMapping("/page")publicRpage(@RequestParamMap<String,Object>params,HttpServletRequestrequest){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));params.put("orderBy","id");PageUtilspage=yonghuService.queryPage(params);//字典表数据转换List<YonghuView>list=(List<YonghuView>)page.getList();for(YonghuViewc:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c);}returnR.ok().put("data",page);}/** * 后端详情 */@RequestMapping("/info/{id}")publicRinfo(@PathVariable("id")Longid){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);YonghuEntityyonghu=yonghuService.selectById(id);if(yonghu!=null){//entity转viewYonghuViewview=newYonghuView();BeanUtils.copyProperties(yonghu,view);//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view);returnR.ok().put("data",view);}else{returnR.error(511,"查不到数据");}}/** * 后端保存 */@RequestMapping("/save")publicRsave(@RequestBodyYonghuEntityyonghu,HttpServletRequestrequest){logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());Wrapper<YonghuEntity>queryWrapper=newEntityWrapper<YonghuEntity>().eq("username",yonghu.getUsername()).or().eq("yonghu_phone",yonghu.getYonghuPhone()).or().eq("yonghu_id_number",yonghu.getYonghuIdNumber());;logger.info("sql语句:"+queryWrapper.getSqlSegment());YonghuEntityyonghuEntity=yonghuService.selectOne(queryWrapper);if(yonghuEntity==null){yonghu.setCreateTime(newDate());yonghu.setPassword("123456");// String role = String.valueOf(request.getSession().getAttribute("role"));// if("".equals(role)){// yonghu.set// }yonghuService.insert(yonghu);returnR.ok();}else{returnR.error(511,"账户或者身份证号或者手机号已经被使用");}}/** * 后端修改 */@RequestMapping("/update")publicRupdate(@RequestBodyYonghuEntityyonghu,HttpServletRequestrequest){logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());//根据字段查询是否有相同数据Wrapper<YonghuEntity>queryWrapper=newEntityWrapper<YonghuEntity>().notIn("id",yonghu.getId()).andNew().eq("username",yonghu.getUsername()).or().eq("yonghu_phone",yonghu.getYonghuPhone()).or().eq("yonghu_id_number",yonghu.getYonghuIdNumber());;logger.info("sql语句:"+queryWrapper.getSqlSegment());YonghuEntityyonghuEntity=yonghuService.selectOne(queryWrapper);if("".equals(yonghu.getYonghuPhoto())||"null".equals(yonghu.getYonghuPhoto())){yonghu.setYonghuPhoto(null);}if(yonghuEntity==null){// String role = String.valueOf(request.getSession().getAttribute("role"));// if("".equals(role)){// yonghu.set// }yonghuService.updateById(yonghu);//根据id更新returnR.ok();}else{returnR.error(511,"账户或者身份证号或者手机号已经被使用");}}/** * 删除 */@RequestMapping("/delete")publicRdelete(@RequestBodyInteger[]ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());yonghuService.deleteBatchIds(Arrays.asList(ids));returnR.ok();}/** * 登录 */@IgnoreAuth@RequestMapping(value="/login")publicRlogin(Stringusername,Stringpassword,Stringcaptcha,HttpServletRequestrequest){YonghuEntityyonghu=yonghuService.selectOne(newEntityWrapper<YonghuEntity>().eq("username",username));if(yonghu==null||!yonghu.getPassword().equals(password)){returnR.error("账号或密码不正确");}Stringtoken=tokenService.generateToken(yonghu.getId(),username,"yonghu","用户");Rr=R.ok();r.put("token",token);r.put("role","用户");r.put("username",yonghu.getYonghuName());r.put("tableName","yonghu");r.put("userId",yonghu.getId());returnr;}/** * 注册 */@IgnoreAuth@PostMapping(value="/register")publicRregister(@RequestBodyYonghuEntityyonghu){// ValidatorUtils.validateEntity(user);if(yonghuService.selectOne(newEntityWrapper<YonghuEntity>().eq("username",yonghu.getUsername()).orNew().eq("yonghu_phone",yonghu.getYonghuPhone()).orNew().eq("yonghu_id_number",yonghu.getYonghuIdNumber()))!=null){returnR.error("账户已存在或手机号或身份证号已经被使用");}yonghuService.insert(yonghu);returnR.ok();}/** * 重置密码 */@GetMapping(value="/resetPassword")publicRresetPassword(Integerid){YonghuEntityyonghu=newYonghuEntity();yonghu.setPassword("123456");yonghu.setId(id);yonghuService.updateById(yonghu);returnR.ok();}/** * 获取用户的session用户信息 */@RequestMapping("/session")publicRgetCurrYonghu(HttpServletRequestrequest){Integerid=(Integer)request.getSession().getAttribute("userId");YonghuEntityyonghu=yonghuService.selectById(id);returnR.ok().put("data",yonghu);}/** * 退出 */@GetMapping(value="logout")publicRlogout(HttpServletRequestrequest){request.getSession().invalidate();returnR.ok("退出成功");}}t("data",yonghu);}/** * 退出 */@GetMapping(value="logout")publicRlogout(HttpServletRequestrequest){request.getSession().invalidate();returnR.ok("退出成功");}}n().invalidate();returnR.ok("退出成功");}}t("data",yonghu);}/** * 退出 */@GetMapping(value="logout")publicRlogout(HttpServletRequestrequest){request.getSession().invalidate();returnR.ok("退出成功");}}
http://www.jsqmd.com/news/848106/

相关文章:

  • 职场习惯-我要慢慢学到
  • Python必备基础知识
  • 虚商注册卡怎么拿货?个人工作室正规拿货渠道|号创平台官方注册链接(含推荐码 181818) - 172号卡
  • 广州模组电源权威推荐榜:佛山台湾明纬开关电源/佛山工业类开关电源/佛山机壳电源/佛山模组电源/佛山电源/佛山系统电源/选择指南 - 优质品牌商家
  • IoT设备OTA升级实战:基于MQTT文件传输协议的设计与避坑指南
  • 从Cornell原始数据到GGCNN输入:一份给机器人视觉研究者的数据流水线拆解
  • 避坑指南:STM32驱动W25Q128时,你的SPI时序和扇区管理可能都错了
  • RT-Thread临界区保护:原理、实现与多线程编程实践
  • Bitwarden悄然变革:价格翻倍背后的隐藏真相
  • 172 号卡推荐码 10000 官方首码|流量卡分销平台唯一源头总码,全网正规流量卡分销认准 10000 - 172号卡
  • 2025最权威的十大降重复率网站实际效果
  • 南充刚需购房中介推荐:南充房产中介哪家靠谱、南充房产中介收费标准、南充房产中介电话、南充房产中介负责哪些事情、南充房产中介门店地址选择指南 - 优质品牌商家
  • Ant Design Vue Table 合计行不显示?别再用 push 了,试试这个 pageSize+1 的巧妙解法
  • 别再用Word手动插文献了!Endnote X9搭配这个国标Style,让你论文排版效率翻倍
  • 财务知识-国内各省产业支撑 - 智慧园区
  • 实测Taotoken多模型路由在高峰期的响应延迟与稳定性表现
  • 2026年当前,北京企业如何甄选高性价比的工程数据治理伙伴? - 2026年企业推荐榜
  • 物业管理企业扩张注册服务品牌推荐:代理记账避坑、代账服务、公司注册代办、公司注册全套服务、公司注册加急、公司注册收费选择指南 - 优质品牌商家
  • 升级 Ubuntu 从 20.04 到 22.04 后三网配置失效怎么办
  • 2026年5月灭菌不锈钢篮采购指南:聚焦实力厂家的核心优势与口碑 - 2026年企业推荐榜
  • 告别纯理论:手把手教你用STM32和OV7725做个实物颜色分拣小车原型
  • 2026乐山留学机构选择全攻略:乐山升学机构联系电话、乐山小语机构图推荐、乐山小语种培训机构推荐、乐山小语种机构培训哪家好选择指南 - 优质品牌商家
  • 广州茅台回收门店实测评测:广州专业名酒回收/广州冬虫夏草回收/广州名表回收/广州名贵礼品回收/广州名贵补品回收/选择指南 - 优质品牌商家
  • 基于雪崩晶体管设计2ns快速边沿脉冲发生器:原理、实现与调试
  • 题解:洛谷 P14073 [GESP202509 五级] 数字选取
  • 工业自动化异构网络通信:Modbus转Profinet网关配置与机器人集成实战
  • 用DCRNN搞定城市交通预测:从论文到PyTorch实战(附METR-LA数据集处理)
  • 2026年乐山临江鳝丝主流品牌工艺技术对比解析:好吃得临江鳝丝是哪家/好吃的钵钵鸡/当地人推荐乐山哪家钵钵鸡店/选择指南 - 优质品牌商家
  • 2026年成人日语网课TOP5技术测评:日语n1网课/日语n2网课/日语一对一网课/日语入门/日语口语培训/日语培训机构/选择指南 - 优质品牌商家
  • LG15645 [ICPC 2022 Tehran R] Network Topology in Hezardastan 题解