wordpress手机模板怎么用,长春网站优化公司,网站建设案例精英,优化软件下载目录 1 项目介绍2 项目截图3 核心代码3.1 Controller3.2 Service3.3 Dao3.4 application.yml3.5 SpringbootApplication3.5 Vue 4 数据库表设计5 文档参考6 计算机毕设选题推荐7 源码获取 1 项目介绍 博主个人介绍#xff1a;CSDN认证博客专家#xff0c;CSDN平台Java领域优质… 目录 1 项目介绍2 项目截图3 核心代码3.1 Controller3.2 Service3.3 Dao3.4 application.yml3.5 SpringbootApplication3.5 Vue 4 数据库表设计5 文档参考6 计算机毕设选题推荐7 源码获取 1 项目介绍 博主个人介绍CSDN认证博客专家CSDN平台Java领域优质创作者全网30w粉丝超300w访问量专注于大学生项目实战开发、讲解和答疑辅导对于专业性数据证明一切 主要项目javaweb、ssm、springboot、vue、小程序、python、安卓、uniapp等设计与开发,万套源码成品可供选择学习。 文末获取源码
SprinBootVue旅游网站的设计与实现(源码数据库文档)
项目描述 嗨玩旅游网站是一个专为旅行爱好者打造的在线平台。我们提供丰富多样的旅游目的地信息包括景点信息、旅游线路、商品信息、社区信息、活动推广等帮助用户轻松规划行程。嗨玩旅游网站致力于为用户提供便捷、实用的旅行服务让每一次旅行都成为难忘的回忆。无论您是独自旅行还是与家人朋友同行嗨玩旅游网站都能满足您的需求让您的旅行更加精彩 系统采用基于Java语言网站开发技术设计的结合Mysql数据库管理系统对旅游相关信息进行管理。按照软件工程学理论完成各阶段设计经过调试测试达到了管理旅游信息的能力。满足了管理员和用户的需要。论文从系统开发过程概述、开发工具简介、系统总体设计、系统开发、软件测试等几个方面进行了介绍。最后总结了系统开发的得失。
2 项目截图 springbootvue旅游网站录像演示 3 核心代码
3.1 Controller package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
RequestMapping(users)
RestController
public class UserController{Autowiredprivate UserService userService;Autowiredprivate TokenService tokenService;/*** 登录*/IgnoreAuthPostMapping(value /login)public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull || !user.getPassword().equals(password)) {return R.error(账号或密码不正确);}String token tokenService.generateToken(user.getId(),username, users, user.getRole());return R.ok().put(token, token);}/*** 注册*/IgnoreAuthPostMapping(value /register)public R register(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername())) !null) {return R.error(用户已存在);}userService.insert(user);return R.ok();}/*** 退出*/GetMapping(value logout)public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok(退出成功);}/*** 密码重置*/IgnoreAuthRequestMapping(value /resetPass)public R resetPass(String username, HttpServletRequest request){UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull) {return R.error(账号不存在);}user.setPassword(123456);userService.update(user,null);return R.ok(密码已重置为123456);}/*** 列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params,UserEntity user){EntityWrapperUserEntity ew new EntityWrapperUserEntity();PageUtils page userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put(data, page);}/*** 列表*/RequestMapping(/list)public R list( UserEntity user){EntityWrapperUserEntity ew new EntityWrapperUserEntity();ew.allEq(MPUtil.allEQMapPre( user, user)); return R.ok().put(data, userService.selectListView(ew));}/*** 信息*/RequestMapping(/info/{id})public R info(PathVariable(id) String id){UserEntity user userService.selectById(id);return R.ok().put(data, user);}/*** 获取用户的session用户信息*/RequestMapping(/session)public R getCurrUser(HttpServletRequest request){Integer id (Integer)request.getSession().getAttribute(userId);UserEntity user userService.selectById(id);return R.ok().put(data, user);}/*** 保存*/PostMapping(/save)public R save(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername())) !null) {return R.error(用户已存在);}userService.insert(user);return R.ok();}/*** 修改*/RequestMapping(/update)public R update(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);UserEntity u userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername()));if(u!null u.getId()!user.getId() u.getUsername().equals(user.getUsername())) {return R.error(用户名已存在。);}userService.updateById(user);//全部更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}
3.2 Service /*** 系统用户*/
public interface UserService extends IServiceUserEntity {PageUtils queryPage(MapString, Object params);ListUserEntity selectListView(WrapperUserEntity wrapper);PageUtils queryPage(MapString, Object params,WrapperUserEntity wrapper);}
3.3 Dao
/*** 用户*/
public interface UserDao extends BaseMapperUserEntity {ListUserEntity selectListView(Param(ew) WrapperUserEntity wrapper);ListUserEntity selectListView(Pagination page,Param(ew) WrapperUserEntity wrapper);}
3.4 application.yml
# Tomcat
server:tomcat:uri-encoding: UTF-8port: 8080servlet:context-path: /springbootpkh49spring:datasource:driverClassName: com.mysql.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/springbootpkh49?useUnicodetruecharacterEncodingutf-8useJDBCCompliantTimezoneShifttrueuseLegacyDatetimeCodefalseserverTimezoneGMT%2B8username: rootpassword: root# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseNamespringbootpkh49
# username: sa
# password: 123456servlet:multipart:max-file-size: 10MBmax-request-size: 10MBresources:static-locations: classpath:static/,file:static/#mybatis
mybatis-plus:mapper-locations: classpath*:mapper/*.xml#实体扫描多个package用逗号或者分号分隔typeAliasesPackage: com.entityglobal-config:#主键类型 0:数据库ID自增, 1:用户输入ID,2:全局唯一ID (数字类型唯一ID), 3:全局唯一ID UUID;id-type: 1#字段策略 0:忽略判断,1:非 NULL 判断),2:非空判断field-strategy: 2#驼峰下划线转换db-column-underline: true#刷新mapper 调试神器refresh-mapper: true#逻辑删除配置logic-delete-value: -1logic-not-delete-value: 0#自定义SQL注入器sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjectorconfiguration:map-underscore-to-camel-case: truecache-enabled: falsecall-setters-on-nulls: true#springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other)jdbc-type-for-null: null
3.5 SpringbootApplication
SpringBootApplication
MapperScan(basePackages {com.dao})
public class SpringbootSchemaApplication extends SpringBootServletInitializer{public static void main(String[] args) {SpringApplication.run(SpringbootSchemaApplication.class, args);}Overrideprotected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {return applicationBuilder.sources(SpringbootSchemaApplication.class);}
}
3.5 Vue
templatedivdiv classcontainer loginIn stylebackgroundImage: url(http://codegen.caihongy.cn/20201206/eaa69c2b4fa742f2b5acefd921a772fc.jpg)div :class2 1 ? left : 2 2 ? left center : left right stylebackgroundColor: rgba(255, 255, 255, 0.71)el-form classlogin-form label-positionleft :label-width1 3 ? 56px : 0pxdiv classtitle-containerh3 classtitle stylecolor: rgba(84, 88, 179, 1)在线文档管理系统登录/h3/divel-form-item :label1 3 ? 用户名 : :classstyle1span v-if1 ! 3 classsvg-container stylecolor:rgba(89, 97, 102, 1);line-height:44pxsvg-icon icon-classuser //spanel-input placeholder请输入用户名 nameusername typetext v-modelrulesForm.username //el-form-itemel-form-item :label1 3 ? 密码 : :classstyle1span v-if1 ! 3 classsvg-container stylecolor:rgba(89, 97, 102, 1);line-height:44pxsvg-icon icon-classpassword //spanel-input placeholder请输入密码 namepassword typepassword v-modelrulesForm.password //el-form-itemel-form-item v-if0 1 classcode :label1 3 ? 验证码 : :classstyle1span v-if1 ! 3 classsvg-container stylecolor:rgba(89, 97, 102, 1);line-height:44pxsvg-icon icon-classcode //spanel-input placeholder请输入验证码 namecode typetext v-modelrulesForm.code /div classgetCodeBt clickgetRandCode(4) styleheight:44px;line-height:44pxspan v-for(item, index) in codes :keyindex :style{color:item.color,transform:item.rotate,fontSize:item.size}{{ item.num }}/span/div/el-form-itemel-form-item label角色 proploginInRole classroleel-radiov-foritem in menusv-ifitem.hasBackLogin是v-bind:keyitem.roleNamev-modelrulesForm.role:labelitem.roleName{{item.roleName}}/el-radio/el-form-itemel-button typeprimary clicklogin() classloginInBt stylepadding:0;font-size:16px;border-radius:4px;height:44px;line-height:44px;width:100%;backgroundColor:rgba(84, 88, 179, 1); borderColor:rgba(84, 88, 179, 1); color:rgba(255, 255, 255, 1){{1 1 ? 登录 : login}}/el-buttonel-form-item classsetting!-- div stylecolor:rgba(255, 255, 255, 1) classreset修改密码/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(255, 255, 255, 1)el.style.color rgba(0, 0, 0, 1)el.style.height 44pxel.style.lineHeight 44pxel.style.borderRadius 2px})document.querySelectorAll(.loginIn .style3 .el-form-item__label).forEach(el{el.style.height 44pxel.style.lineHeight 44px})document.querySelectorAll(.loginIn .el-form-item__label).forEach(el{el.style.color rgba(89, 97, 102, 1)})setTimeout((){document.querySelectorAll(.loginIn .role .el-radio__label).forEach(el{el.style.color rgba(84, 88, 179, 1)})},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(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(rotatedeg)// 随机验证码字体大小let size Math.floor(Math.random()*sizes.length)this.codes[i].size sizes[size]px}},}
};
/script
style langscss 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
4 数据库表设计
用户注册实体图如图所示
数据库表的设计如下表
5 文档参考 6 计算机毕设选题推荐
最新计算机软件毕业设计选题大全整理中…
7 源码获取
获取联系方式在文章末尾 如果想入行提升技术的可以看我专栏其他内容
文章转载自: http://www.morning.gfmpk.cn.gov.cn.gfmpk.cn http://www.morning.rlhgx.cn.gov.cn.rlhgx.cn http://www.morning.c7629.cn.gov.cn.c7629.cn http://www.morning.dlrsjc.com.gov.cn.dlrsjc.com http://www.morning.mfct.cn.gov.cn.mfct.cn http://www.morning.xnlj.cn.gov.cn.xnlj.cn http://www.morning.xxsrm.cn.gov.cn.xxsrm.cn http://www.morning.symgk.cn.gov.cn.symgk.cn http://www.morning.xbmwh.cn.gov.cn.xbmwh.cn http://www.morning.bfhfb.cn.gov.cn.bfhfb.cn http://www.morning.ngzkt.cn.gov.cn.ngzkt.cn http://www.morning.rlfr.cn.gov.cn.rlfr.cn http://www.morning.knscf.cn.gov.cn.knscf.cn http://www.morning.jkmjm.cn.gov.cn.jkmjm.cn http://www.morning.qwbtr.cn.gov.cn.qwbtr.cn http://www.morning.tzzxs.cn.gov.cn.tzzxs.cn http://www.morning.tlfzp.cn.gov.cn.tlfzp.cn http://www.morning.qkpzq.cn.gov.cn.qkpzq.cn http://www.morning.jrkzk.cn.gov.cn.jrkzk.cn http://www.morning.rcklc.cn.gov.cn.rcklc.cn http://www.morning.lsfbb.cn.gov.cn.lsfbb.cn http://www.morning.lwlnw.cn.gov.cn.lwlnw.cn http://www.morning.lbpfl.cn.gov.cn.lbpfl.cn http://www.morning.sskns.cn.gov.cn.sskns.cn http://www.morning.qyfqx.cn.gov.cn.qyfqx.cn http://www.morning.playmi.cn.gov.cn.playmi.cn http://www.morning.pshpx.cn.gov.cn.pshpx.cn http://www.morning.lftpl.cn.gov.cn.lftpl.cn http://www.morning.cpmfp.cn.gov.cn.cpmfp.cn http://www.morning.lzph.cn.gov.cn.lzph.cn http://www.morning.xknmn.cn.gov.cn.xknmn.cn http://www.morning.stwxr.cn.gov.cn.stwxr.cn http://www.morning.ryxdr.cn.gov.cn.ryxdr.cn http://www.morning.syznh.cn.gov.cn.syznh.cn http://www.morning.jyfrz.cn.gov.cn.jyfrz.cn http://www.morning.ddfp.cn.gov.cn.ddfp.cn http://www.morning.kpqjr.cn.gov.cn.kpqjr.cn http://www.morning.bkcnq.cn.gov.cn.bkcnq.cn http://www.morning.kqlrl.cn.gov.cn.kqlrl.cn http://www.morning.xphcg.cn.gov.cn.xphcg.cn http://www.morning.srbfz.cn.gov.cn.srbfz.cn http://www.morning.rlksq.cn.gov.cn.rlksq.cn http://www.morning.dbrpl.cn.gov.cn.dbrpl.cn http://www.morning.flfdm.cn.gov.cn.flfdm.cn http://www.morning.qfwzm.cn.gov.cn.qfwzm.cn http://www.morning.kzrbd.cn.gov.cn.kzrbd.cn http://www.morning.xsszn.cn.gov.cn.xsszn.cn http://www.morning.kfmlf.cn.gov.cn.kfmlf.cn http://www.morning.zwzwn.cn.gov.cn.zwzwn.cn http://www.morning.sh-wj.com.cn.gov.cn.sh-wj.com.cn http://www.morning.htbgz.cn.gov.cn.htbgz.cn http://www.morning.wpqcj.cn.gov.cn.wpqcj.cn http://www.morning.hmjasw.com.gov.cn.hmjasw.com http://www.morning.yqrgq.cn.gov.cn.yqrgq.cn http://www.morning.yrjhr.cn.gov.cn.yrjhr.cn http://www.morning.lwtfx.cn.gov.cn.lwtfx.cn http://www.morning.kpqjr.cn.gov.cn.kpqjr.cn http://www.morning.bdgb.cn.gov.cn.bdgb.cn http://www.morning.smhtg.cn.gov.cn.smhtg.cn http://www.morning.yqwrj.cn.gov.cn.yqwrj.cn http://www.morning.dbfj.cn.gov.cn.dbfj.cn http://www.morning.zyffq.cn.gov.cn.zyffq.cn http://www.morning.jxzfg.cn.gov.cn.jxzfg.cn http://www.morning.wptdg.cn.gov.cn.wptdg.cn http://www.morning.jlktz.cn.gov.cn.jlktz.cn http://www.morning.qiyelm.com.gov.cn.qiyelm.com http://www.morning.qjtbt.cn.gov.cn.qjtbt.cn http://www.morning.xqqcq.cn.gov.cn.xqqcq.cn http://www.morning.qbrs.cn.gov.cn.qbrs.cn http://www.morning.ptzf.cn.gov.cn.ptzf.cn http://www.morning.hfnbr.cn.gov.cn.hfnbr.cn http://www.morning.znmwb.cn.gov.cn.znmwb.cn http://www.morning.cbczs.cn.gov.cn.cbczs.cn http://www.morning.nrwr.cn.gov.cn.nrwr.cn http://www.morning.xckrj.cn.gov.cn.xckrj.cn http://www.morning.nktgj.cn.gov.cn.nktgj.cn http://www.morning.lwnb.cn.gov.cn.lwnb.cn http://www.morning.lsbjj.cn.gov.cn.lsbjj.cn http://www.morning.lqqqh.cn.gov.cn.lqqqh.cn http://www.morning.kehejia.com.gov.cn.kehejia.com