当前位置:   article > 正文

基于SpringBoot+Vue校园失物招领网站的设计与实现_校园失物招领网站开发

校园失物招领网站开发

文末获取联系

开发语言:Java

使用框架:spring boot

前端技术:Vue 、css、element-ui、js

开发工具:IDEA/MyEclipse/Eclipse、Visual Studio Code

数据库:MySQL 5.7/8.0

数据库管理工具:phpstudy/Navicat

JDK版本:jdk1.8

Maven:apache-maven 3.8.1-bin

项目介绍: 

近年来,信息化管理行业的不断兴起,使得人们的日常生活越来越离不开计算机和互联网技术。首先,根据收集到的用户需求分析,对设计系统有一个初步的认识与了解,确定校园失物招领网站的总体功能模块。然后,详细设计系统的主要功能模块,通过数据库设计过程将相关的数据信息存储到数据库中,再通过使用关键的开发工具,如IDEA开发平台、AJAX技术等,编码设计相关的功能模块。接着,主要采用功能测试的方式对系统进行测试,找出系统在运行过程中存在的问题,以及解决问题的方法,不断地改进和完善系统的设计。最后,总结本文介绍的系统的设计和实现过程,并且针对于系统的开发提出未来的展望工作。本系统的研发具有重大的意义,在安全性方面,用户使用浏览器访问网站时,采用注册和密码等相关的保护措施,提高系统的可靠性,维护用户的个人信息和财产的安全。在方便性方面,促进了校园失物招领网站的信息化建设,极大的方便了相关的工作人员对校园失物招领网站信息进行管理。

功能介绍: 

部分截图说明: 

首页

失物信息

寻物启事

个人中心

管理员登录界面

失物招领管理界面

用户管理

公告管理

部分代码: 

  1. /**
  2. * 上传文件映射表
  3. */
  4. @RestController
  5. @RequestMapping("file")
  6. @SuppressWarnings({"unchecked","rawtypes"})
  7. public class FileController{
  8. @Autowired
  9. private ConfigService configService;
  10. /**
  11. * 上传文件
  12. */
  13. @RequestMapping("/upload")
  14. public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
  15. if (file.isEmpty()) {
  16. throw new EIException("上传文件不能为空");
  17. }
  18. String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
  19. File path = new File(ResourceUtils.getURL("classpath:static").getPath());
  20. if(!path.exists()) {
  21. path = new File("");
  22. }
  23. File upload = new File(path.getAbsolutePath(),"/upload/");
  24. if(!upload.exists()) {
  25. upload.mkdirs();
  26. }
  27. String fileName = new Date().getTime()+"."+fileExt;
  28. File dest = new File(upload.getAbsolutePath()+"/"+fileName);
  29. file.transferTo(dest);
  30. if(StringUtils.isNotBlank(type) && type.equals("1")) {
  31. ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
  32. if(configEntity==null) {
  33. configEntity = new ConfigEntity();
  34. configEntity.setName("faceFile");
  35. configEntity.setValue(fileName);
  36. } else {
  37. configEntity.setValue(fileName);
  38. }
  39. configService.insertOrUpdate(configEntity);
  40. }
  41. return R.ok().put("file", fileName);
  42. }
  43. /**
  44. * 下载文件
  45. */
  46. @IgnoreAuth
  47. @RequestMapping("/download")
  48. public ResponseEntity<byte[]> download(@RequestParam String fileName) {
  49. try {
  50. File path = new File(ResourceUtils.getURL("classpath:static").getPath());
  51. if(!path.exists()) {
  52. path = new File("");
  53. }
  54. File upload = new File(path.getAbsolutePath(),"/upload/");
  55. if(!upload.exists()) {
  56. upload.mkdirs();
  57. }
  58. File file = new File(upload.getAbsolutePath()+"/"+fileName);
  59. if(file.exists()){
  60. /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
  61. getResponse().sendError(403);
  62. }*/
  63. HttpHeaders headers = new HttpHeaders();
  64. headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
  65. headers.setContentDispositionFormData("attachment", fileName);
  66. return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
  67. }
  68. } catch (IOException e) {
  69. e.printStackTrace();
  70. }
  71. return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
  72. }
  73. }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/436391
推荐阅读
相关标签
  

闽ICP备14008679号