[免费]SpringBoot+Vue景区订票(购票)体系【论文+源码+SQL脚本】 ...

打印 上一主题 下一主题

主题 1027|帖子 1027|积分 3081

大家好,我是java1234_小锋老师,看到一个不错的SpringBoot+Vue大景区订票(购票)体系,分享下哈。
项目视频演示

【免费】SpringBoot+Vue景区订票(购票)体系 Java毕业筹划_哔哩哔哩_bilibili


项目介绍

现代经济快节奏发展以及不停美满升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本景区订票体系就是在如许的大环境下诞生,其可以资助使用者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以资助管理职员进步事件处理效率,达到事半功倍的结果。此景区订票体系利用当下成熟美满的Spring Boot框架,使用跨平台的可开辟大型贸易网站的Java语言,以及最受接待的RDBMS应用软件之一的MySQL数据库进行程序开辟。景区订票体系有管理员,用户两个脚色。管理员功能有个人中心,景点范例管理,公告范例管理,景点信息管理,公告信息管理,论坛管理,用户信息管理,轮播图管理,景点留言管理,景点收藏管理,旅游景点预定管理。用户可以注册登录,查看景点信息,查看公告信息,查看论坛信息并且可以在论坛发言,可以在景点信息上留言和预定。景区订票体系的开辟根据操作职员需要筹划的界面轻巧美观,在功能模块结构上跟同范例网站保持同等,程序在实现基本要求功能时,也为数据信息面对的安全题目提供了一些实用的办理方案。可以说该程序在资助使用者高效率地处理工作事件的同时,也实现了数据信息的整体化,规范化与自动化。

体系展示



部门代码

  1. package com.controller;
  2. import java.util.Arrays;
  3. import java.util.Map;
  4. import javax.servlet.http.HttpServletRequest;
  5. import com.service.UsersService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.PathVariable;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.RequestBody;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RequestParam;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import com.annotation.IgnoreAuth;
  15. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  16. import com.entity.UsersEntity;
  17. import com.service.TokenService;
  18. import com.utils.MPUtil;
  19. import com.utils.PageUtils;
  20. import com.utils.R;
  21. /**
  22. * 登录相关
  23. */
  24. @RequestMapping("users")
  25. @RestController
  26. public class UsersController {
  27.        
  28.         @Autowired
  29.         private UsersService usersService;
  30.        
  31.         @Autowired
  32.         private TokenService tokenService;
  33.         /**
  34.          * 登录
  35.          */
  36.         @IgnoreAuth
  37.         @PostMapping(value = "/login")
  38.         public R login(String username, String password, String captcha, HttpServletRequest request) {
  39.                 UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
  40.                 if(user==null || !user.getPassword().equals(password)) {
  41.                         return R.error("账号或密码不正确");
  42.                 }
  43.                 String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
  44.                 R r = R.ok();
  45.                 r.put("token", token);
  46.                 r.put("role",user.getRole());
  47.                 r.put("userId",user.getId());
  48.                 return r;
  49.         }
  50.        
  51.         /**
  52.          * 注册
  53.          */
  54.         @IgnoreAuth
  55.         @PostMapping(value = "/register")
  56.         public R register(@RequestBody UsersEntity user){
  57. //            ValidatorUtils.validateEntity(user);
  58.             if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
  59.                     return R.error("用户已存在");
  60.             }
  61.         usersService.insert(user);
  62.         return R.ok();
  63.     }
  64.         /**
  65.          * 退出
  66.          */
  67.         @GetMapping(value = "logout")
  68.         public R logout(HttpServletRequest request) {
  69.                 request.getSession().invalidate();
  70.                 return R.ok("退出成功");
  71.         }
  72.        
  73.         /**
  74.      * 密码重置
  75.      */
  76.     @IgnoreAuth
  77.         @RequestMapping(value = "/resetPass")
  78.     public R resetPass(String username, HttpServletRequest request){
  79.             UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
  80.             if(user==null) {
  81.                     return R.error("账号不存在");
  82.             }
  83.             user.setPassword("123456");
  84.         usersService.update(user,null);
  85.         return R.ok("密码已重置为:123456");
  86.     }
  87.        
  88.         /**
  89.      * 列表
  90.      */
  91.     @RequestMapping("/page")
  92.     public R page(@RequestParam Map<String, Object> params,UsersEntity user){
  93.         EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
  94.             PageUtils page = usersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
  95.         return R.ok().put("data", page);
  96.     }
  97.         /**
  98.      * 列表
  99.      */
  100.     @RequestMapping("/list")
  101.     public R list( UsersEntity user){
  102.                EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
  103.               ew.allEq(MPUtil.allEQMapPre( user, "user"));
  104.         return R.ok().put("data", usersService.selectListView(ew));
  105.     }
  106.     /**
  107.      * 信息
  108.      */
  109.     @RequestMapping("/info/{id}")
  110.     public R info(@PathVariable("id") String id){
  111.         UsersEntity user = usersService.selectById(id);
  112.         return R.ok().put("data", user);
  113.     }
  114.    
  115.     /**
  116.      * 获取用户的session用户信息
  117.      */
  118.     @RequestMapping("/session")
  119.     public R getCurrUser(HttpServletRequest request){
  120.             Integer id = (Integer)request.getSession().getAttribute("userId");
  121.         UsersEntity user = usersService.selectById(id);
  122.         return R.ok().put("data", user);
  123.     }
  124.     /**
  125.      * 保存
  126.      */
  127.     @PostMapping("/save")
  128.     public R save(@RequestBody UsersEntity user){
  129. //            ValidatorUtils.validateEntity(user);
  130.             if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
  131.                     return R.error("用户已存在");
  132.             }
  133.             user.setPassword("123456");
  134.         usersService.insert(user);
  135.         return R.ok();
  136.     }
  137.     /**
  138.      * 修改
  139.      */
  140.     @RequestMapping("/update")
  141.     public R update(@RequestBody UsersEntity user){
  142. //        ValidatorUtils.validateEntity(user);
  143.         usersService.updateById(user);//全部更新
  144.         return R.ok();
  145.     }
  146.     /**
  147.      * 删除
  148.      */
  149.     @RequestMapping("/delete")
  150.     public R delete(@RequestBody Long[] ids){
  151.         usersService.deleteBatchIds(Arrays.asList(ids));
  152.         return R.ok();
  153.     }
  154. }
复制代码
  1. <template>
  2.     <div>
  3.         <div class="container loginIn" style="backgroundImage: url(/laonianrenjingqudingpiao/img/back-img-bg.jpg)">
  4.             <div :class="2 == 1 ? 'left' : 2 == 2 ? 'left center' : 'left right'" style="backgroundColor: rgba(255, 255, 255, 1)">
  5.                 <el-form class="login-form" label-position="left" :label-width="3 == 3 ? '56px' : '0px'">
  6.                     <div class="title-container"><h3 class="title" style="color: rgba(149, 184, 226, 1)">景区订票系统</h3></div>
  7.                     <el-form-item :label="3 == 3 ? '用户名' : ''" :class="'style'+3">
  8.                         <span v-if="3 != 3" class="svg-container" style="color:rgba(136, 154, 164, 1);line-height:50px"><svg-icon icon-class="user" /></span>
  9.                         <el-input placeholder="请输入用户名" name="username" type="text" v-model="rulesForm.username" />
  10.                     </el-form-item>
  11.                     <el-form-item :label="3 == 3 ? '密码' : ''" :class="'style'+3">
  12.                         <span v-if="3 != 3" class="svg-container" style="color:rgba(136, 154, 164, 1);line-height:50px"><svg-icon icon-class="password" /></span>
  13.                         <el-input placeholder="请输入密码" name="password" type="password" v-model="rulesForm.password" />
  14.                     </el-form-item>
  15.                     <el-form-item v-if="0 == '1'" class="code" :label="3 == 3 ? '验证码' : ''" :class="'style'+3">
  16.                         <span v-if="3 != 3" class="svg-container" style="color:rgba(136, 154, 164, 1);line-height:50px"><svg-icon icon-class="code" /></span>
  17.                         <el-input placeholder="请输入验证码" name="code" type="text" v-model="rulesForm.code" />
  18.                         <div class="getCodeBt" @click="getRandCode(4)" style="height:50px;line-height:50px">
  19.                             <span v-for="(item, index) in codes" :key="index" :style="{color:item.color,transform:item.rotate,fontSize:item.size}">{{ item.num }}</span>
  20.                         </div>
  21.                     </el-form-item>
  22.                     <el-form-item label="角色" prop="loginInRole" class="role">
  23.                         <el-radio
  24.                                 v-for="item in menus"
  25.                                 v-if="item.hasBackLogin=='是'"
  26.                                 v-bind:key="item.roleName"
  27.                                 v-model="rulesForm.role"
  28.                                 :label="item.roleName"
  29.                         >{{item.roleName}}</el-radio>
  30.                     </el-form-item>
  31.                     <el-button type="primary" @click="login()" class="loginInBt" style="padding:0;font-size:16px;border-radius:15px;height:44px;line-height:44px;width:100%;backgroundColor:rgba(149, 184, 226, 1); borderColor:rgba(149, 184, 226, 1); color:rgba(255, 255, 255, 1)">{{'2' == '1' ? '登录' : 'login'}}</el-button>
  32.                     <el-form-item class="setting">
  33.             <div style="color:rgba(149, 184, 226, 1)" class="register" @click="register('yonghu')">用户注册</div>
  34.                     </el-form-item>
  35.                
  36.                 </el-form>
  37.             </div>
  38.         </div>
  39.     </div>
  40. </template>
  41. <script>
  42.     import menu from "@/utils/menu";
  43.     export default {
  44.         data() {
  45.             return {
  46.                 rulesForm: {
  47.                     username: "",
  48.                     password: "",
  49.                     role: "",
  50.                     code: '',
  51.                 },
  52.                 menus: [],
  53.                 tableName: "",
  54.                 codes: [{
  55.                     num: 1,
  56.                     color: '#000',
  57.                     rotate: '10deg',
  58.                     size: '16px'
  59.                 },{
  60.                     num: 2,
  61.                     color: '#000',
  62.                     rotate: '10deg',
  63.                     size: '16px'
  64.                 },{
  65.                     num: 3,
  66.                     color: '#000',
  67.                     rotate: '10deg',
  68.                     size: '16px'
  69.                 },{
  70.                     num: 4,
  71.                     color: '#000',
  72.                     rotate: '10deg',
  73.                     size: '16px'
  74.                 }],
  75.             };
  76.         },
  77.         mounted() {
  78.             let menus = menu.list();
  79.             this.menus = menus;
  80.         },
  81.         created() {
  82.             this.setInputColor()
  83.             this.getRandCode()
  84.         },
  85.         methods: {
  86.             setInputColor(){
  87.                 this.$nextTick(()=>{
  88.                     document.querySelectorAll('.loginIn .el-input__inner').forEach(el=>{
  89.                         el.style.backgroundColor = "rgba(194, 189, 189, 0.42)"
  90.                         el.style.color = "rgba(51, 51, 51, 1)"
  91.                         el.style.height = "50px"
  92.                         el.style.lineHeight = "50px"
  93.                         el.style.borderRadius = "15px"
  94.                     })
  95.                     document.querySelectorAll('.loginIn .style3 .el-form-item__label').forEach(el=>{
  96.                         el.style.height = "50px"
  97.                         el.style.lineHeight = "50px"
  98.                     })
  99.                     document.querySelectorAll('.loginIn .el-form-item__label').forEach(el=>{
  100.                         el.style.color = "rgb(0 0 0)"
  101.                     })
  102.                     setTimeout(()=>{
  103.                         document.querySelectorAll('.loginIn .role .el-radio__label').forEach(el=>{
  104.                             el.style.color = "rgb(0 0 0)"
  105.                         })
  106.                     },350)
  107.                 })
  108.             },
  109.             register(tableName){
  110.                 this.$storage.set("loginTable", tableName);
  111.                 this.$router.push({path:'/register'})
  112.             },
  113.             // 登陆
  114.             login() {
  115.                 let code = ''
  116.                 for(let i in this.codes) {
  117.                     code += this.codes[i].num
  118.                 }
  119.                 if ('0' == '1' && !this.rulesForm.code) {
  120.                     this.$message.error("请输入验证码");
  121.                     return;
  122.                 }
  123.                 if ('0' == '1' && this.rulesForm.code.toLowerCase() != code.toLowerCase()) {
  124.                     this.$message.error("验证码输入有误");
  125.                     this.getRandCode()
  126.                     return;
  127.                 }
  128.                 if (!this.rulesForm.username) {
  129.                     this.$message.error("请输入用户名");
  130.                     return;
  131.                 }
  132.                 if (!this.rulesForm.password) {
  133.                     this.$message.error("请输入密码");
  134.                     return;
  135.                 }
  136.                 if (!this.rulesForm.role) {
  137.                     this.$message.error("请选择角色");
  138.                     return;
  139.                 }
  140.                 let menus = this.menus;
  141.                 for (let i = 0; i < menus.length; i++) {
  142.                     if (menus[i].roleName == this.rulesForm.role) {
  143.                         this.tableName = menus[i].tableName;
  144.                     }
  145.                 }
  146.                 this.$http({
  147.                     url: `${this.tableName}/login?username=${this.rulesForm.username}&password=${this.rulesForm.password}`,
  148.                     method: "post"
  149.                 }).then(({ data }) => {
  150.                     if (data && data.code === 0) {
  151.                         this.$storage.set("Token", data.token);
  152.                         this.$storage.set("userId", data.userId);
  153.                         this.$storage.set("role", this.rulesForm.role);
  154.                         this.$storage.set("sessionTable", this.tableName);
  155.                         this.$storage.set("adminName", this.rulesForm.username);
  156.                         this.$router.replace({ path: "/index/" });
  157.                     } else {
  158.                         this.$message.error(data.msg);
  159.                     }
  160.                 });
  161.             },
  162.             getRandCode(len = 4){
  163.                 this.randomString(len)
  164.             },
  165.             randomString(len = 4) {
  166.                 let chars = [
  167.                     "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
  168.                     "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
  169.                     "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
  170.                     "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
  171.                     "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
  172.                     "3", "4", "5", "6", "7", "8", "9"
  173.                 ]
  174.                 let colors = ["0", "1", "2","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]
  175.                 let sizes = ['14', '15', '16', '17', '18']
  176.                 let output = [];
  177.                 for (let i = 0; i < len; i++) {
  178.                     // 随机验证码
  179.                     let key = Math.floor(Math.random()*chars.length)
  180.                     this.codes[i].num = chars[key]
  181.                     // 随机验证码颜色
  182.                     let code = '#'
  183.                     for (let j = 0; j < 6; j++) {
  184.                         let key = Math.floor(Math.random()*colors.length)
  185.                         code += colors[key]
  186.                     }
  187.                     this.codes[i].color = code
  188.                     // 随机验证码方向
  189.                     let rotate = Math.floor(Math.random()*60)
  190.                     let plus = Math.floor(Math.random()*2)
  191.                     if(plus == 1) rotate = '-'+rotate
  192.                     this.codes[i].rotate = 'rotate('+rotate+'deg)'
  193.                     // 随机验证码字体大小
  194.                     let size = Math.floor(Math.random()*sizes.length)
  195.                     this.codes[i].size = sizes[size]+'px'
  196.                 }
  197.             },
  198.         }
  199.     };
  200. </script>
  201. <style lang="scss" scoped>
  202.     .loginIn {
  203.         min-height: 100vh;
  204.         position: relative;
  205.         background-repeat: no-repeat;
  206.         background-position: center center;
  207.         background-size: cover;
  208.     .left {
  209.         position: absolute;
  210.         left: 0;
  211.         top: 0;
  212.         width: 360px;
  213.         height: 100%;
  214.     .login-form {
  215.         background-color: transparent;
  216.         width: 100%;
  217.         right: inherit;
  218.         padding: 0 12px;
  219.         box-sizing: border-box;
  220.         display: flex;
  221.         justify-content: center;
  222.         flex-direction: column;
  223.     }
  224.     .title-container {
  225.         text-align: center;
  226.         font-size: 24px;
  227.     .title {
  228.         margin: 20px 0;
  229.     }
  230.     }
  231.     .el-form-item {
  232.         position: relative;
  233.     .svg-container {
  234.         padding: 6px 5px 6px 15px;
  235.         color: #889aa4;
  236.         vertical-align: middle;
  237.         display: inline-block;
  238.         position: absolute;
  239.         left: 0;
  240.         top: 0;
  241.         z-index: 1;
  242.         padding: 0;
  243.         line-height: 40px;
  244.         width: 30px;
  245.         text-align: center;
  246.     }
  247.     .el-input {
  248.         display: inline-block;
  249.         height: 40px;
  250.         width: 100%;
  251.     & /deep/ input {
  252.           background: transparent;
  253.           border: 0px;
  254.           -webkit-appearance: none;
  255.           padding: 0 15px 0 30px;
  256.           color: #fff;
  257.           height: 40px;
  258.       }
  259.     }
  260.     }
  261.     }
  262.     .center {
  263.         position: absolute;
  264.         left: 50%;
  265.         top: 50%;
  266.         width: 360px;
  267.         transform: translate3d(-50%,-50%,0);
  268.         height: 446px;
  269.         border-radius: 8px;
  270.     }
  271.     .right {
  272.         position: absolute;
  273.         left: inherit;
  274.         right: 0;
  275.         top: 0;
  276.         width: 360px;
  277.         height: 100%;
  278.     }
  279.     .code {
  280.     .el-form-item__content {
  281.         position: relative;
  282.     .getCodeBt {
  283.         position: absolute;
  284.         right: 0;
  285.         top: 0;
  286.         line-height: 40px;
  287.         width: 100px;
  288.         background-color: rgba(51,51,51,0.4);
  289.         color: #fff;
  290.         text-align: center;
  291.         border-radius: 0 4px 4px 0;
  292.         height: 40px;
  293.         overflow: hidden;
  294.     span {
  295.         padding: 0 5px;
  296.         display: inline-block;
  297.         font-size: 16px;
  298.         font-weight: 600;
  299.     }
  300.     }
  301.     .el-input {
  302.     & /deep/ input {
  303.           padding: 0 130px 0 30px;
  304.       }
  305.     }
  306.     }
  307.     }
  308.     .setting {
  309.     & /deep/ .el-form-item__content {
  310.           padding: 0 15px;
  311.           box-sizing: border-box;
  312.           line-height: 32px;
  313.           height: 32px;
  314.           font-size: 14px;
  315.           color: #999;
  316.           margin: 0 !important;
  317.     .register {
  318.         float: left;
  319.         width: 50%;
  320.     }
  321.     .reset {
  322.         float: right;
  323.         width: 50%;
  324.         text-align: right;
  325.     }
  326.     }
  327.     }
  328.     .style2 {
  329.         padding-left: 30px;
  330.     .svg-container {
  331.         left: -30px !important;
  332.     }
  333.     .el-input {
  334.     & /deep/ input {
  335.           padding: 0 15px !important;
  336.       }
  337.     }
  338.     }
  339.     .code.style2, .code.style3 {
  340.     .el-input {
  341.     & /deep/ input {
  342.           padding: 0 115px 0 15px;
  343.       }
  344.     }
  345.     }
  346.     .style3 {
  347.     & /deep/ .el-form-item__label {
  348.           padding-right: 6px;
  349.       }
  350.     .el-input {
  351.     & /deep/ input {
  352.           padding: 0 15px !important;
  353.       }
  354.     }
  355.     }
  356.     .role {
  357.     & /deep/ .el-form-item__label {
  358.           width: 56px !important;
  359.       }
  360.     & /deep/ .el-radio {
  361.           margin-right: 12px;
  362.       }
  363.     }
  364.     }
  365. </style>
复制代码
源码代码

链接:https://pan.baidu.com/s/1ZF_rrnE_IT3B-v-xGXLWrg
提取码:1234


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

大号在练葵花宝典

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表