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

分享一套优质的微信小程序校园志愿者系统(SpringBoot后端+Vue3管理端)

大家好,我是锋哥,看到一个不错的微信小程序校园志愿者系统(SpringBoot后端+Vue3管理端),分享下哈。

项目介绍

随着新世纪的到来,无纸化办公的潮流席卷全球,自动化信息处理技术和基于网络的信息交流方式逐渐成为各行各业的主流。计算机不仅接管了众多行业的管理和测试任务,还成为了线上管理体系不可或缺的一环。这一变革极大提升了工作效率,但同时也带来了数据泄露的风险。因此,为确保数据安全,我们必须采取一系列先进的安全措施和技术手段。

最终,我们的努力得到了回报。测试结果表明,这款以微信小程序为载体的校园志愿服务活动系统不仅功能齐全,而且性能稳定,完全能够满足校园志愿服务活动的需求。它的出现不仅为用户提供了更为便捷的使用体验,还促进了资源的循环利用,实现了环保和经济的双赢

源码下载

链接:https://pan.baidu.com/s/1vtxtOkt6W3M0t4LsTzsRmA?pwd=1234
提取码:1234

系统展示

核心代码

package com.example.controller; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import com.example.common.Result; import com.example.common.ResultCode; import com.example.entity.Account; import com.example.entity.AuthorityInfo; import com.example.exception.CustomException; import com.example.entity.AdminInfo; import com.example.entity.UserInfo; import com.example.service.AdminInfoService; import com.example.service.UserInfoService; import org.springframework.web.bind.annotation.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import cn.hutool.json.JSONUtil; import java.util.*; import java.util.stream.Collectors; @RestController public class AccountController { @Value("${authority.info}") private String authorityStr; @Resource private AdminInfoService adminInfoService; @Resource private UserInfoService userInfoService; @PostMapping("/login") public Result<Account> login(@RequestBody Account account, HttpServletRequest request) { if (StrUtil.isBlank(account.getName()) || StrUtil.isBlank(account.getPassword()) || account.getLevel() == null) { throw new CustomException(ResultCode.PARAM_LOST_ERROR); } Integer level = account.getLevel(); Account login = new Account(); if (1 == level) { login = adminInfoService.login(account.getName(), account.getPassword()); } if (2 == level) { login = userInfoService.login(account.getName(), account.getPassword()); } request.getSession().setAttribute("user", login); return Result.success(login); } @PostMapping("/register") public Result<Account> register(@RequestBody Account account) { Integer level = account.getLevel(); Account login = new Account(); if (1 == level) { AdminInfo info = new AdminInfo(); BeanUtils.copyProperties(account, info); login = adminInfoService.add(info); } if (2 == level) { UserInfo info = new UserInfo(); BeanUtils.copyProperties(account, info); login = userInfoService.add(info); } return Result.success(login); } @GetMapping("/logout") public Result logout(HttpServletRequest request) { request.getSession().setAttribute("user", null); return Result.success(); } @GetMapping("/auth") public Result getAuth(HttpServletRequest request) { Object user = request.getSession().getAttribute("user"); if(user == null) { return Result.error("401", "未登录"); } return Result.success(user); } @GetMapping("/getAccountInfo") public Result<Object> getAccountInfo(HttpServletRequest request) { Account account = (Account) request.getSession().getAttribute("user"); if (account == null) { return Result.success(new Object()); } Integer level = account.getLevel(); if (1 == level) { return Result.success(adminInfoService.findById(account.getId())); } if (2 == level) { return Result.success(userInfoService.findById(account.getId())); } return Result.success(new Object()); } @GetMapping("/getSession") public Result<Map<String, String>> getSession(HttpServletRequest request) { Account account = (Account) request.getSession().getAttribute("user"); if (account == null) { return Result.success(new HashMap<>(1)); } Map<String, String> map = new HashMap<>(1); map.put("username", account.getName()); return Result.success(map); } @GetMapping("/getAuthority") public Result<List<AuthorityInfo>> getAuthorityInfo() { List<AuthorityInfo> authorityInfoList = JSONUtil.toList(JSONUtil.parseArray(authorityStr), AuthorityInfo.class); return Result.success(authorityInfoList); } /** * 获取当前用户所能看到的模块信息 * @param request * @return */ @GetMapping("/authority") public Result<List<Integer>> getAuthorityInfo(HttpServletRequest request) { Account user = (Account) request.getSession().getAttribute("user"); if (user == null) { return Result.success(new ArrayList<>()); } JSONArray objects = JSONUtil.parseArray(authorityStr); for (Object object : objects) { JSONObject jsonObject = (JSONObject) object; if (user.getLevel().equals(jsonObject.getInt("level"))) { JSONArray array = JSONUtil.parseArray(jsonObject.getStr("models")); List<Integer> modelIdList = array.stream().map((o -> { JSONObject obj = (JSONObject) o; return obj.getInt("modelId"); })).collect(Collectors.toList()); return Result.success(modelIdList); } } return Result.success(new ArrayList<>()); } @GetMapping("/permission/{modelId}") public Result<List<Integer>> getPermission(@PathVariable Integer modelId, HttpServletRequest request) { List<AuthorityInfo> authorityInfoList = JSONUtil.toList(JSONUtil.parseArray(authorityStr), AuthorityInfo.class); Account user = (Account) request.getSession().getAttribute("user"); if (user == null) { return Result.success(new ArrayList<>()); } Optional<AuthorityInfo> optional = authorityInfoList.stream().filter(x -> x.getLevel().equals(user.getLevel())).findFirst(); if (optional.isPresent()) { Optional<AuthorityInfo.Model> firstOption = optional.get().getModels().stream().filter(x -> x.getModelId().equals(modelId)).findFirst(); if (firstOption.isPresent()) { List<Integer> info = firstOption.get().getOperation(); return Result.success(info); } } return Result.success(new ArrayList<>()); } @PutMapping("/updatePassword") public Result updatePassword(@RequestBody Account info, HttpServletRequest request) { Account account = (Account) request.getSession().getAttribute("user"); if (account == null) { return Result.error(ResultCode.USER_NOT_EXIST_ERROR.code, ResultCode.USER_NOT_EXIST_ERROR.msg); } String oldPassword = SecureUtil.md5(info.getPassword()); if (!oldPassword.equals(account.getPassword())) { return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg); } info.setPassword(SecureUtil.md5(info.getNewPassword())); Integer level = account.getLevel(); if (1 == level) { AdminInfo adminInfo = new AdminInfo(); BeanUtils.copyProperties(info, adminInfo); adminInfoService.update(adminInfo); } if (2 == level) { UserInfo userInfo = new UserInfo(); BeanUtils.copyProperties(info, userInfo); userInfoService.update(userInfo); } info.setLevel(level); info.setName(account.getName()); // 清空session,让用户重新登录 request.getSession().setAttribute("user", null); return Result.success(); } @PostMapping("/resetPassword") public Result resetPassword(@RequestBody Account account) { Integer level = account.getLevel(); if (1 == level) { AdminInfo info = adminInfoService.findByUserName(account.getName()); if (info == null) { return Result.error(ResultCode.USER_NOT_EXIST_ERROR.code, ResultCode.USER_NOT_EXIST_ERROR.msg); } info.setPassword(SecureUtil.md5("123456")); adminInfoService.update(info); } if (2 == level) { UserInfo info = userInfoService.findByUserName(account.getName()); if (info == null) { return Result.error(ResultCode.USER_NOT_EXIST_ERROR.code, ResultCode.USER_NOT_EXIST_ERROR.msg); } info.setPassword(SecureUtil.md5("123456")); userInfoService.update(info); } return Result.success(); } }
http://www.jsqmd.com/news/354853/

相关文章:

  • 告别繁琐排版!5款操作零门槛的AI PPT生成工具推荐 - 品牌测评鉴赏家
  • 口碑好的桥梁PVC排水管源头厂家有哪些 - 工业推荐榜
  • 2026年广州婚纱工作室公司口碑推荐:实力强婚纱工作室/稳定的婚纱工作室/声誉好的婚纱工作室婚纱影楼/拍婚纱照 - 品牌策略师
  • 手写mybatis
  • 新手PPT救星!5款零门槛生成工具实测:教育党职场人闭眼入,省时80% - 品牌测评鉴赏家
  • 分析2026年别墅门厂家十大排名,看哪家费用更合理 - 工业品牌热点
  • 分析法式装修设计费用多少钱,重庆哪家性价比高 - 工业品网
  • Java 中使用 Alibaba Fastjson 解析泛型类型 JsonResult<SysUserDTO> 的问题
  • 讲讲风机进风口价格合理的供应商,怎么选择有攻略 - mypinpai
  • 完整教程:基于python新闻数据分析可视化系统 Hadoop 新闻平台 爬虫 情感分析 舆情分析 可视化 Django框架 vue框架 机器学习 大数据毕业设计✅
  • 解读全国拉力试验机优质生产商,桌上型拉力试验机怎么收费 - 工业设备
  • 2026重庆装修公司费用对比,十二分装饰能免费上门量房设计吗 - 工业品牌热点
  • 分享ROHS2.0检测仪推荐厂家,高灵敏度产品盘点 - 工业品牌热点
  • 2025年-2026年全屋定制品牌推荐:基于长期稳定性评测,涵盖居家与办公场景痛点分析 - 十大品牌推荐
  • 2026年高新企业审计外部审计推荐,靠谱品牌供应商盘点 - 工业品网
  • 永辉超市购物卡回收变现攻略:快速兑换现金的方法! - 团团收购物卡回收
  • 选安防门关注这些优势,熊熊集团口碑好值得考虑吗? - 工业推荐榜
  • 分析浙江口碑不错的别墅门源头厂家,推荐哪家 - 工业推荐榜
  • 2026年诺丁山艺术中心婚礼价格哪家性价比高,灯光效果揭秘 - 工业品网
  • Java语言提供了八种基本类型。六种数字类型【函数函数123】
  • 2026年口碑好的一站式婚礼企业盘点,费用怎么收 - 工业设备
  • 摆脱论文困扰! 降AIGC平台 千笔·专业降AIGC智能体 VS 笔捷Ai 专科生专属
  • 2026年河北靠谱的牧草膜品牌推荐,口碑好的牧草膜源头厂家全解析 - myqiye
  • 2026年上海值得关注的检测设备品牌,聊聊台硕检测影像测量仪性价比 - 工业设备
  • 2025年-2026年云电脑推荐:基于办公与生产场景评价,针对数据泄露与运维复杂痛点 - 十大品牌推荐
  • 2026年浙江地区粗糙度轮廓仪选购攻略,按需定制费用如何 - 工业设备
  • 格式总出错?AI论文写作软件 千笔·专业论文写作工具 VS PaperRed
  • 2026年肉骨粉干燥机厂家推荐及选购参考:饲料烘干机/豆渣烘干机/羽毛粉干燥机/羽毛粉烘干机/餐厨垃圾烘干机 - 品牌策略师
  • 上海智推时代GEO联系方式整理!2026最新官方渠道汇总 - 速递信息
  • 2026年羽毛粉生产设备公司实力排行:羽毛粉水解罐/鸭毛加工设备/水解羽毛粉设备/鸡毛粉生产设备/高蛋白羽毛粉生产设备 - 品牌策略师