免费分享一套SpringBoot+Vue火车票订票管理系统【论文+源码+SQL脚本】,帅呆了~~

大家好,我是java1234_小锋老师,看到一个不错的SpringBoot+Vue火车票订票管理系统,分享下哈。

项目视频演示

【免费】Springboot+Vue火车票订票管理系统 Java毕业设计_哔哩哔哩_bilibili

项目介绍

传统办法管理信息首先需要花费的时间比较多,其次数据出错率比较高,而且对错误的数据进行更改也比较困难,最后,检索数据费事费力。因此,在计算机上安装火车票订票系统软件来发挥其高效地信息处理的作用,可以规范信息管理流程,让管理工作可以系统化和程序化,同时,火车票订票系统的有效运用可以帮助管理人员准确快速地处理信息。

火车票订票系统在对开发工具的选择上也很慎重,为了便于开发实现,选择的开发工具为Eclipse,选择的数据库工具为Mysql。以此搭建开发环境实现火车票订票系统的功能。其中管理员管理用户,新闻公告。

火车票订票系统是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,火车票订票系统都可以轻松应对。

系统展示

部分代码


package com.controller;import java.util.Arrays;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import com.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.UsersEntity;
import com.service.TokenService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UsersController {@Autowiredprivate UsersService usersService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());R r = R.ok();r.put("token", token);r.put("role",user.getRole());r.put("userId",user.getId());return r;}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UsersEntity user){
//    	ValidatorUtils.validateEntity(user);if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}usersService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");usersService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UsersEntity user){EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();PageUtils page = usersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UsersEntity user){EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", usersService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UsersEntity user = usersService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Integer id = (Integer)request.getSession().getAttribute("userId");UsersEntity user = usersService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UsersEntity user){
//    	ValidatorUtils.validateEntity(user);if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}user.setPassword("123456");usersService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UsersEntity user){
//        ValidatorUtils.validateEntity(user);usersService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){usersService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}
<template><div><div class="container loginIn" style="backgroundImage: url(/huochpiaodingpiao/img/back-img-bg.jpg)"><div :class="2 == 1 ? 'left' : 2 == 2 ? 'left center' : 'left right'" style="backgroundColor: rgba(225, 225, 225, 1)"><el-form class="login-form" label-position="left" :label-width="3 == 3 ? '56px' : '0px'"><div class="title-container"><h3 class="title" style="color: rgba(244, 91, 75, 1)">火车票订票系统</h3></div><el-form-item :label="3 == 3 ? '用户名' : ''" :class="'style'+3"><span v-if="3 != 3" class="svg-container" style="color:rgba(136, 154, 164, 1);line-height:46px"><svg-icon icon-class="user" /></span><el-input placeholder="请输入用户名" name="username" type="text" v-model="rulesForm.username" /></el-form-item><el-form-item :label="3 == 3 ? '密码' : ''" :class="'style'+3"><span v-if="3 != 3" class="svg-container" style="color:rgba(136, 154, 164, 1);line-height:46px"><svg-icon icon-class="password" /></span><el-input placeholder="请输入密码" name="password" type="password" v-model="rulesForm.password" /></el-form-item><el-form-item v-if="0 == '1'" class="code" :label="3 == 3 ? '验证码' : ''" :class="'style'+3"><span v-if="3 != 3" class="svg-container" style="color:rgba(136, 154, 164, 1);line-height:46px"><svg-icon icon-class="code" /></span><el-input placeholder="请输入验证码" name="code" type="text" v-model="rulesForm.code" /><div class="getCodeBt" @click="getRandCode(4)" style="height:46px;line-height:46px"><span v-for="(item, index) in codes" :key="index" :style="{color:item.color,transform:item.rotate,fontSize:item.size}">{{ item.num }}</span></div></el-form-item><el-form-item label="角色" prop="loginInRole" class="role"><el-radiov-for="item in menus"v-if="item.hasBackLogin=='是'"v-bind:key="item.roleName"v-model="rulesForm.role":label="item.roleName">{{item.roleName}}</el-radio></el-form-item><el-button type="primary" @click="login()" class="loginInBt" style="padding:0;font-size:17px;border-radius:25px;height:40px;line-height:40px;width:100%;backgroundColor:rgba(244, 91, 75, 1); borderColor:rgba(244, 91, 75, 1); color:rgba(255, 255, 255, 1)">{{'1' == '1' ? '登录' : 'login'}}</el-button><el-form-item class="setting"><div style="color:rgba(0, 150, 136, 1)" class="register" @click="register('yonghu')">会员注册</div></el-form-item></el-form></div></div></div>
</template>
<script>import menu from "@/utils/menu";export default {data() {return {rulesForm: {username: "",password: "",role: "",code: '',},menus: [],tableName: "",codes: [{num: 1,color: '#000',rotate: '10deg',size: '16px'},{num: 2,color: '#000',rotate: '10deg',size: '16px'},{num: 3,color: '#000',rotate: '10deg',size: '16px'},{num: 4,color: '#000',rotate: '10deg',size: '16px'}],};},mounted() {let menus = menu.list();this.menus = menus;},created() {this.setInputColor()this.getRandCode()},methods: {setInputColor(){this.$nextTick(()=>{document.querySelectorAll('.loginIn .el-input__inner').forEach(el=>{el.style.backgroundColor = "rgba(202, 202, 202, 1)"el.style.color = "rgba(129, 129, 129, 1)"el.style.height = "46px"el.style.lineHeight = "46px"el.style.borderRadius = "25px"})document.querySelectorAll('.loginIn .style3 .el-form-item__label').forEach(el=>{el.style.height = "46px"el.style.lineHeight = "46px"})document.querySelectorAll('.loginIn .el-form-item__label').forEach(el=>{el.style.color = "rgb(0 0 0)"})setTimeout(()=>{document.querySelectorAll('.loginIn .role .el-radio__label').forEach(el=>{el.style.color = "rgb(0 0 0)"})},350)})},register(tableName){this.$storage.set("loginTable", tableName);this.$router.push({path:'/register'})},// 登陆login() {let code = ''for(let i in this.codes) {code += this.codes[i].num}if ('0' == '1' && !this.rulesForm.code) {this.$message.error("请输入验证码");return;}if ('0' == '1' && this.rulesForm.code.toLowerCase() != code.toLowerCase()) {this.$message.error("验证码输入有误");this.getRandCode()return;}if (!this.rulesForm.username) {this.$message.error("请输入用户名");return;}if (!this.rulesForm.password) {this.$message.error("请输入密码");return;}if (!this.rulesForm.role) {this.$message.error("请选择角色");return;}let menus = this.menus;for (let i = 0; i < menus.length; i++) {if (menus[i].roleName == this.rulesForm.role) {this.tableName = menus[i].tableName;}}this.$http({url: `${this.tableName}/login?username=${this.rulesForm.username}&password=${this.rulesForm.password}`,method: "post"}).then(({ data }) => {if (data && data.code === 0) {this.$storage.set("Token", data.token);this.$storage.set("userId", data.userId);this.$storage.set("role", this.rulesForm.role);this.$storage.set("sessionTable", this.tableName);this.$storage.set("adminName", this.rulesForm.username);this.$router.replace({ path: "/index/" });} else {this.$message.error(data.msg);}});},getRandCode(len = 4){this.randomString(len)},randomString(len = 4) {let chars = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k","l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v","w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G","H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R","S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2","3", "4", "5", "6", "7", "8", "9"]let colors = ["0", "1", "2","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]let sizes = ['14', '15', '16', '17', '18']let output = [];for (let i = 0; i < len; i++) {// 随机验证码let key = Math.floor(Math.random()*chars.length)this.codes[i].num = chars[key]// 随机验证码颜色let code = '#'for (let j = 0; j < 6; j++) {let key = Math.floor(Math.random()*colors.length)code += colors[key]}this.codes[i].color = code// 随机验证码方向let rotate = Math.floor(Math.random()*60)let plus = Math.floor(Math.random()*2)if(plus == 1) rotate = '-'+rotatethis.codes[i].rotate = 'rotate('+rotate+'deg)'// 随机验证码字体大小let size = Math.floor(Math.random()*sizes.length)this.codes[i].size = sizes[size]+'px'}},}};
</script>
<style lang="scss" scoped>.loginIn {min-height: 100vh;position: relative;background-repeat: no-repeat;background-position: center center;background-size: cover;.left {position: absolute;left: 0;top: 0;width: 360px;height: 100%;.login-form {background-color: transparent;width: 100%;right: inherit;padding: 0 12px;box-sizing: border-box;display: flex;justify-content: center;flex-direction: column;}.title-container {text-align: center;font-size: 24px;.title {margin: 20px 0;}}.el-form-item {position: relative;.svg-container {padding: 6px 5px 6px 15px;color: #889aa4;vertical-align: middle;display: inline-block;position: absolute;left: 0;top: 0;z-index: 1;padding: 0;line-height: 40px;width: 30px;text-align: center;}.el-input {display: inline-block;height: 40px;width: 100%;& /deep/ input {background: transparent;border: 0px;-webkit-appearance: none;padding: 0 15px 0 30px;color: #fff;height: 40px;}}}}.center {position: absolute;left: 50%;top: 50%;width: 360px;transform: translate3d(-50%,-50%,0);height: 446px;border-radius: 8px;}.right {position: absolute;left: inherit;right: 0;top: 0;width: 360px;height: 100%;}.code {.el-form-item__content {position: relative;.getCodeBt {position: absolute;right: 0;top: 0;line-height: 40px;width: 100px;background-color: rgba(51,51,51,0.4);color: #fff;text-align: center;border-radius: 0 4px 4px 0;height: 40px;overflow: hidden;span {padding: 0 5px;display: inline-block;font-size: 16px;font-weight: 600;}}.el-input {& /deep/ input {padding: 0 130px 0 30px;}}}}.setting {& /deep/ .el-form-item__content {padding: 0 15px;box-sizing: border-box;line-height: 32px;height: 32px;font-size: 14px;color: #999;margin: 0 !important;.register {float: left;width: 50%;}.reset {float: right;width: 50%;text-align: right;}}}.style2 {padding-left: 30px;.svg-container {left: -30px !important;}.el-input {& /deep/ input {padding: 0 15px !important;}}}.code.style2, .code.style3 {.el-input {& /deep/ input {padding: 0 115px 0 15px;}}}.style3 {& /deep/ .el-form-item__label {padding-right: 6px;}.el-input {& /deep/ input {padding: 0 15px !important;}}}.role {& /deep/ .el-form-item__label {width: 56px !important;}& /deep/ .el-radio {margin-right: 12px;}}}
</style>

源码代码

链接:https://pan.baidu.com/s/15MDI4YEvV2xz0tm7wKxXfA
提取码:1234

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/148644.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

基于Springboot个性化图书推荐系统JAVA|VUE|SSM计算机毕业设计源代码+数据库+LW文档+开题报告+答辩稿+部署教+代码讲解

源代码数据库LW文档&#xff08;1万字以上&#xff09;开题报告答辩稿 部署教程代码讲解代码时间修改教程 一、开发工具、运行环境、开发技术 开发工具 1、操作系统&#xff1a;Window操作系统 2、开发工具&#xff1a;IntelliJ IDEA或者Eclipse 3、数据库存储&#xff1a…

优思学院|TQM和ISO9001有什么关系?

TQM 和 ISO 9001有什么关系&#xff1f;我们把这个问题交给AI&#xff0c;它的回答是&#xff1a; 老实说&#xff0c;说它答错&#xff0c;又不算是错&#xff0c;但说它答对&#xff0c;也不算&#xff0c;总之就是一种模凌两可的感觉。 为什么会这样&#xff1f;因为管理中…

【gradio介绍】Python 可视化 web 神器---gradio介绍

Gradio是一个开源的Python库&#xff0c;专为帮助开发者快速搭建和分享机器学习模型、API或任意Python函数的用户界面&#xff08;UI&#xff09;而设计。它基于FastAPI和Svelte&#xff0c;是一个易于部署且功能强大的Web界面构建工具&#xff0c;特别适用于展示和测试机器学习…

在产品上扩大库存?教你一招!全开源!

几乎所有人都会遇到的头疼问题&#xff1a;内存不够&#xff0c;因为很多照片、音频、文档药存储。。。 我们都知道芯片的储存都是寸土寸金的&#xff0c;内部不够只能外扩&#xff01; 有没有简单一点的方法呢&#xff1f;实在不想编写各种驱动&#xff0c;替换Flash&#x…

探索未来:MultiOn,AI的下一个革命

文章目录 探索未来&#xff1a;MultiOn&#xff0c;AI的下一个革命背景&#xff1a;为什么选择MultiOn&#xff1f;MultiOn是什么&#xff1f;如何安装MultiOn&#xff1f;简单的库函数使用方法场景应用常见问题及解决方案总结 探索未来&#xff1a;MultiOn&#xff0c;AI的下一…

conda环境下module ‘numba.types‘ has no attribute ‘Macro‘问题解决

1 问题描述 conda环境下运行数据处理&#xff0c;报出如下错误&#xff1a; Traceback (most recent call last):File "train_preprocess.py", line 13, in <module>import audioFile "/opt/service/lipsync/audio.py", line 1, in <module>…

增强网络威胁防御能力的云安全新兴技术

一些行业专家强调了基于云的运营的独特网络安全需求&#xff0c;并指出保护敏感数据与传统的本地网络不同。尽管新兴技术并没有改变网络安全专业人员与犯罪分子之间持续的斗争&#xff0c;但它们提高了赌注&#xff0c;使斗争变得更加复杂。 如今&#xff0c;我们面对的是技术…

药用植物的空间多组学:从生物合成途径到工业应用-文献精读51

Spatial multi-omics in medicinal plants: from biosynthesis pathways to industrial applications 药用植物的空间多组学&#xff1a;从生物合成途径到工业应用 摘要 随着分子测序和成像技术的快速发展&#xff0c;药用植物的多组学研究进入了单细胞时代。我们讨论了空间多…

西安云仪:心无旁骛做实业 精益求精造仪表

仪器仪表&#xff0c;被誉为工业生产的“倍增器”&#xff0c;是国家测量精度和科技发展水平的重要体现。近年来&#xff0c;我国仪器仪表产业正在稳步增长。据统计&#xff0c;2023年实现营收10112亿元&#xff0c;正式进入万亿元时代&#xff0c;部分高端产品已经达到或接近国…

阿里云「通义灵码」迎来重磅升级,「AI 程序员」正式亮相!

最近两年&#xff0c;随着大语言模型和生成式 AI 技术的爆火&#xff0c;软件开发领域首当其冲成为了最热门的大模型应用场景之一&#xff0c;GitHub Copilot、通义灵码等 AI 辅助编程工具纷纷问世。这些工具通过自然语言处理和机器学习技术&#xff0c;能够理解开发者的意图&a…

USB转8路串口 USB转8路RS232 USB转8路TTL

一、功能描述 本模块采用CH348Q芯片作为主芯片&#xff0c;CH348 是一款高速 USB 总线的转接芯片&#xff0c;实现USB转八个异步串口UARTA/B/C/D/E/F/G/H 功能&#xff0c; 用于为计算机扩展异步串口&#xff0c;或者将普通的串口设备或者MCU直接升级到USB总线。外加4颗MAX323…

Leetcode 每日一题:Diameter of Binary Tree

写在前面&#xff1a; 最近被学校的 campus involvement 社团活动的招新宣传和选拔&#xff0c;以及找工作频繁的参加招聘会和网上申请忙的焦头烂额&#xff0c;马上又要到来的期中考试让我再次意识到了大学生活的险恶。虽然大家都说学生时代是最幸福的时代&#xff0c;但这个…

Vue3使用通信组件库mitt作为事件总线实现跨组件通信

mitt 介绍: Mitt 是一个在 Vue.js 应用程序中使用的小型事件总线库。该库允许组件进行通信&#xff0c;而不必过度依赖父级或子级组件之间的 props。 先看项目用例&#xff1a; 【 以下转载自&#xff1a;https://blog.csdn.net/yuanlong12178/article/details/139579299 】…

无人机飞手教员培训持证,必须会组装,模拟,维修才能带好学员

无人机飞手员的教培训不应仅仅局限于获取飞行执照或证书&#xff0c;而应是一个全面等多、方面的深入能力且&#xff0c;实践以确保导向能够的过程全面。、一个有效地合格的指导无人机学员飞。手教员不仅需要掌握扎实的飞行技能&#xff0c;还需要具备组装、模拟训练、维修。 组…

线性调频信号脉冲压缩并非是一个门信号

如果是频域是门信号&#xff0c;时域是sinc信号&#xff0c;时间越长震荡只会越小。图象是线性卷积做的&#xff0c;肯定没错。

SGLang——结构化语言模型程序的高效执行

前言 大型语言模型 (LLM) 越来越多地用于需要多次生成调用、高级提示技术、控制流和结构化输入/输出的复杂任务。然而&#xff0c;缺乏用于编程和执行这些应用程序的高效系统。新推出的系统 SGLang 旨在通过提供复杂语言模型程序的高效执行来解决这一问题。SGLang 包含前端语言…

828华为云征文|华为云Flexus X轻松实现Redis一主多从高效部署

目录 前言 一、华为云Flexus X加速Redis购买 1.1 Flexus X实例购买 1.2 Redis加速镜像选择 1.3 重置密码 1.4 登录Flexus X实例 1.5 Flexus X实例Redis验证 二、华为云Flexus X主节点Redis配置 2.1 重置密码 2.2 Redis外部访问配置 三、华为云Flexus X从节点Redis配置 3.1 从机…

亚马逊商品详情数据接口:提升运营排名的工具

亚马逊商品详情数据接口是亚马逊平台提供的一种服务&#xff0c;允许用户通过程序调用API&#xff08;应用程序接口&#xff09;来获取亚马逊商品的相关数据。这个接口为开发者和商家提供了丰富的商品信息&#xff0c;有助于优化用户体验、支持购买决策、竞品分析和市场研究等。…

Comfyui海报工作流:出图快,质量高!

前言 工作流获取方式放在这里了 在快节奏的现代生活中&#xff0c;高效的工作流程对于企业和个人而言&#xff0c;无疑是提升竞争力的关键。 特别是在设计领域&#xff0c;能够快速而精准地完成海报设计&#xff0c;不仅意味着时间的节省&#xff0c;更代表着工作效率的飞跃。…

玩转图像处理:Python与OpenCV实现高效绿幕背景替换

文章目录 前言色度抠图技术&#xff08;Chroma Keying&#xff09;基本原理 数据准备代码实现性能分析代码优化优化后的速度 前言 现阶段绿幕抠图有很多种方式&#xff0c;比如色度抠图&#xff08;Chroma Keying&#xff09;、亮度抠图&#xff08;Luma Keying&#xff09;、色…