——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明










基于javaweb的SSM+Maven微信小程序快递柜管理系统(java+ssm+vue+wxml+wxss+mysql)
后端启动:Tomcat
前端web管理端:npm run serve
前端小程序端:微信开发者工具
基于ssm的快递柜管理微信小程序系统
项目介绍
基于ssm的快递柜管理微信小程序系统
角色:管理员、用户两种角色,分为小程序端和后台管理两部分;
用户:用户通过小程序登录页面可以填写用户名和密码等信息进行登录操作,登录成功后,进入首页可以查看首页、公告资讯、驿站信息、快递信息、取件记录、我的 等功能模块,进行相对应操作;
管理员:管理员登录成功后进入到系统操作界面,可以对个人中心、驿站信息管理、用户管理、快递信息管理、取件记录管理、系统管理等功能模块进行相对应操作。
使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
技术栈
后端:Spring+SpringMvc+Mybaits+Vue
前端:WXML(类似于HTML)、WXSS(类似于CSS)和JavaScript
管理员(web端):
admin 123456
用户(小程序端):
用户名1 123456
用户名2 123456
用户名3 123456
用户名4 123456
用户名5 123456
用户名6 123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| }
@RequestMapping("/save") public R save(@RequestBody NewsEntity news, HttpServletRequest request){ news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
newsService.insert(news); return R.ok(); }
@RequestMapping("/add") public R add(@RequestBody NewsEntity news, HttpServletRequest request){ news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
newsService.insert(news); return R.ok(); }
@RequestMapping("/update") public R update(@RequestBody NewsEntity news, HttpServletRequest request){ newsService.updateById(news); return R.ok(); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
@Component public class AuthorizationInterceptor implements HandlerInterceptor {
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired private TokenService tokenService; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Max-Age", "3600"); response.setHeader("Access-Control-Allow-Credentials", "true"); response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"); response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
IgnoreAuth annotation; if (handler instanceof HandlerMethod) { annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class); } else { return true; }
String token = request.getHeader(LOGIN_TOKEN_KEY);
if(annotation!=null) { return true; }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| @Autowired private YonghuService yonghuService;
@Autowired private TokenService tokenService;
@IgnoreAuth @RequestMapping(value = "/login") public R login(String username, String password, String captcha, HttpServletRequest request) { YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", username)); if(user==null || !user.getMima().equals(password)) { return R.error("账号或密码不正确"); } String token = tokenService.generateToken(user.getId(), username,"yonghu", "用户" ); return R.ok().put("token", token); }
@IgnoreAuth @RequestMapping("/register") public R register(@RequestBody YonghuEntity yonghu){ YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming())); if(user!=null) { return R.error("注册用户已存在"); } Long uId = new Date().getTime(); yonghu.setId(uId); yonghuService.insert(yonghu); return R.ok(); }
@RequestMapping("/logout") public R logout(HttpServletRequest request) { request.getSession().invalidate(); return R.ok("退出成功"); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| @IgnoreAuth @RequestMapping(value = "/login") public R login(String username, String password, String captcha, HttpServletRequest request) { YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", username)); if(user==null || !user.getMima().equals(password)) { return R.error("账号或密码不正确"); } String token = tokenService.generateToken(user.getId(), username,"yonghu", "用户" ); return R.ok().put("token", token); }
@IgnoreAuth @RequestMapping("/register") public R register(@RequestBody YonghuEntity yonghu){ YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming())); if(user!=null) { return R.error("注册用户已存在"); } Long uId = new Date().getTime(); yonghu.setId(uId); yonghuService.insert(yonghu); return R.ok(); }
@RequestMapping("/logout") public R logout(HttpServletRequest request) { request.getSession().invalidate(); return R.ok("退出成功"); }
@RequestMapping("/session") public R getCurrUser(HttpServletRequest request){ Long id = (Long)request.getSession().getAttribute("userId"); YonghuEntity user = yonghuService.selectById(id); return R.ok().put("data", user); }
@IgnoreAuth
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| } user.setMima("123456"); yonghuService.updateById(user); return R.ok("密码已重置为:123456"); }
@RequestMapping("/page") public R page(@RequestParam Map<String, Object> params,YonghuEntity yonghu, HttpServletRequest request){
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>(); PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params)); return R.ok().put("data", page); }
@IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params,YonghuEntity yonghu, HttpServletRequest request){ EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>(); PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params)); return R.ok().put("data", page); }
@RequestMapping("/lists") public R list( YonghuEntity yonghu){ EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>(); ew.allEq(MPUtil.allEQMapPre( yonghu, "yonghu")); return R.ok().put("data", yonghuService.selectListView(ew)); }
@RequestMapping("/query") public R query(YonghuEntity yonghu){ EntityWrapper< YonghuEntity> ew = new EntityWrapper< YonghuEntity>(); ew.allEq(MPUtil.allEQMapPre( yonghu, "yonghu")); YonghuView yonghuView = yonghuService.selectView(ew); return R.ok("查询用户成功").put("data", yonghuView); }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=571524512608201oa
https://javayms.pages.dev?id=571524512608201oa