一、前言
🌞博主介绍:✌全网粉丝15W+,CSDN特邀作者、211毕业、高级全栈开发程序员、大厂多年工作经验、码云/掘金/华为云/阿里云/InfoQ/StackOverflow/github等平台优质作者、专注于Java、小程序技术领域和毕业项目实战,以及程序定制化开发、全栈讲解、就业辅导✌🌞
毕业设计选题非常重要!非常重要!非常重要!(一定要收藏起来)
选题指导:近期开题的同学越来越多,很多同学不知道怎么选题,不知道老师分配的题目应该怎么做,指导老师分享的信息不多,无从下手?
选题避坑:毕设选题实际上对很多同学来说一个大坑, 每年挖坑给自己跳的人太多太多,选题选得好后面的答辩以及论文撰写会轻松很多,选的不好就是一个无穷无尽的折磨
难度把控:其实这主要是由于大部分同学对某种具体场景所需要的技术不清晰而导致的,定题的时候想当然的觉得某种功能是很好实现的,但是实际上往往并非如此。
所以,建议对课题实现技术不清晰的同学,最好是找自己的研究生学长或者老师详细的把关机技术以及实现流程理清楚,当然也可以来找我问我(免费)
以下为我整理的一些适合同学们毕业设计的项目,大家可以参考一下-记得收藏。
文章最下面有微信,获取完整源码和数据库,没有套路,没有套路,没有套路!!!
网上大部分的毕设套路如下:
<span style="background-color:#f8f8f8"><span style="color:#333333">1. 在b站发毕设项目的演示视频,让你免费领取,你领取完发现代码不全或者数据库少表,根本跑不起来!如果要调试则收费300:sweat_smile:真的是恶心至极有没有!
2. 某宝找人帮忙写,简单来说比第一种行为靠谱,但是很贵!说是可以免费修改其实修改基本排不上队,一改就是一星期,想快点?加钱,200加急!:sweat_smile:</span></span>
-
成品购买,这种不多说适合于自己懂一点的同学
👇🏻 精彩专栏推荐订阅👇🏻 Java项目精品实战案例 微信小程序项目精品案例 🌟文末获取源码+数据库🌟
三、SpringBoot选题参考
-
微信小程序生鲜销售管理系统
-
微信小程序新闻网站
-
微信小程序的图书管理系统代码
-
微信小程序计算机专业英语学习平台
-
微信小程序电子阅读器设计与实现
-
微信小程序英语学习小助手的设计
-
微信小程序废品回收类小程序
-
微信小程序校园快递代取
-
微信小程序宠物交易系统
-
微信小程序便捷订货系统
-
微信小程序便捷记账本小程序
-
微信小程序旅游服务平台
-
微信小程序租房信息管理系统
-
微信小程序中医知识库
-
微信小程序在线学习平台
-
微信小程序音乐播放器
-
微信小程序小说阅读书城
-
微信小程序随便点奶茶小程序
-
微信小程序驾考小助手
-
微信小程序美容预约
-
微信小程序同学会
-
微信小程序科普之家小程序
-
微信小程序卫生应急培训系统设计与实现
-
微信小程序校园自动点餐系统
-
微信小程序武夷山垃圾分类
-
微信小程序跳蚤市场
-
微信小程序社区疫情防控系统
-
微信小程序029社区防控系统
-
微信小程序030订餐系统
-
微信小程序031旅游景点酒店预订管理系统
-
微信小程序032资助定制游
-
微信小程序033知茶叶商城考试错题
-
微信小程序034在线医生答疑系统
-
微信小程序035在线学习平台
-
微信小程序036在线考试系统
-
微信小程序037应聘系统
-
微信小程序038医疗微服务预约挂号
-
微信小程序038易农产品多商家小程序
-
微信小程序039学生信息课程考试,错题,发帖,管理
-
微信小程序040校园维修平台的设计
-
微信小程序041校园维修平台
-
微信小程序042校园租房指南
-
微信小程序043校园跑腿
-
微信小程序045校园二手交易
-
微信小程序046校园达达互助平台
-
微信小程序047家电子产品维修售后服务
-
微信小程序048课程分享平台
-
微信小程序049竞赛管理系统
-
微信小程序050社区居民疫情服务系统
-
微信小程序051快递取件及上门服务
-
微信小程序052劳务咨询系统设计与实现
-
微信小程序053超市购物
-
微信小程序054超市购物系统
-
微信小程序055答题系统
-
微信小程序056大学生心理测试
-
微信小程序057灯具商城
-
微信小程序058小区疫情防控
-
微信小程序059校友录吕梁学院
-
微信小程序060巧匠家装小程序
-
微信小程序060电脑维修预约
-
微信小程序061点餐订餐充值系统
-
微信小程序061电影院购票平台
-
微信小程序062菜品点餐订餐系统带桌号
-
微信小程序063美食点餐推荐演示
-
微信小程序064二手交易
-
微信小程序065我爱美食网站
-
微信小程序066四六级英语助手
-
微信小程序067好物分享系统
-
微信小程序068户外体能训练
-
微信小程序069房屋租赁系统设计与实现
-
微信小程序070食堂订餐
-
微信小程序071食谱大全
-
微信小程序072健身教练私教预约系统
-
微信小程序073个人理财打卡运动打卡管理软件
-
微信小程序074公益知识学习测试
-
微信小程序075河南师范大学好物分享系统
-
微信小程序076护工服务预约
-
微信小程序077高校机房设备报修小助手
-
微信小程序078加油服务系统
-
微信小程序079家庭理财产品
-
微信小程序080家校通程序
-
微信小程序081驾校教培小程序
-
微信小程序082教材销售系统
-
微信小程序083线上教学辅助
-
微信小程序084物流仓储系统
-
微信小程序085图书借阅系统
-
微信小程序086社区心理健康服务
-
微信小程序087刷题网站
-
微信小程序088投票系统
-
微信小程序089社区物品租赁
-
微信小程序090在线视频教育系统小程序
-
微信小程序091师生答疑交流平台
-
微信小程序092每日签到打卡
-
微信小程序093网上药店管理系统
-
微信小程序094家园社区生活事务报修缴费
-
微信小程序095培训机构课程报名系统
-
微信小程序096祛痘美容减肥个人健康交流打卡
-
微信小程序097校园美食评论餐饮配送
-
微信小程序098校园快递代领平台小程序
-
微信小程序099家教平台
六、数据库设计参考
<span style="background-color:#f8f8f8"><span style="color:#333333"><span style="color:#aa5500">-- MySQL dump 10.13 Distrib 5.7.31, for Linux (x86_64)</span>
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Host: localhost Database: springbootm3ord</span>
<span style="color:#aa5500">-- ------------------------------------------------------</span>
<span style="color:#aa5500">-- Server version 5.7.31</span>
<span style="color:#aa5500">/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */</span>;
<span style="color:#aa5500">/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */</span>;
<span style="color:#aa5500">/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */</span>;
<span style="color:#aa5500">/*!40101 SET NAMES utf8 */</span>;
<span style="color:#aa5500">/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */</span>;
<span style="color:#aa5500">/*!40103 SET TIME_ZONE='+00:00' */</span>;
<span style="color:#aa5500">/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */</span>;
<span style="color:#aa5500">/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */</span>;
<span style="color:#aa5500">/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */</span>;
<span style="color:#aa5500">/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Current Database: `springbootm3ord`</span>
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">/*!40000 DROP DATABASE IF EXISTS `springbootm3ord`*/</span>;
<span style="color:#770088">CREATE</span> DATABASE <span style="color:#aa5500">/*!32312 IF NOT EXISTS*/</span> `springbootm3ord` <span style="color:#aa5500">/*!40100 DEFAULT CHARACTER SET utf8mb4 */</span>;
USE `springbootm3ord`;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `aboutus`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `aboutus`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `aboutus` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`addtime` <span style="color:#3300aa">timestamp</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> DEFAULT CURRENT_TIMESTAMP COMMENT <span style="color:#aa1111">'创建时间'</span>,
`title` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'标题'</span>,
`subtitle` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'副标题'</span>,
`content` <span style="color:#3300aa">longtext</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'内容'</span>,
`picture1` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'图片1'</span>,
`picture2` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'图片2'</span>,
`picture3` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'图片3'</span>,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=<span style="color:#116644">2</span> DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'关于我们'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Dumping data for table `aboutus`</span>
<span style="color:#aa5500">--</span>
LOCK TABLES `aboutus` WRITE;
<span style="color:#aa5500">/*!40000 ALTER TABLE `aboutus` DISABLE KEYS */</span>;
<span style="color:#770088">INSERT</span> <span style="color:#770088">INTO</span> `aboutus` <span style="color:#770088">VALUES</span> (<span style="color:#116644">1</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'关于我们'</span>,<span style="color:#aa1111">'ABOUT US'</span>,<span style="color:#aa1111">'不管你想要怎样的生活,你都要去努力争取,不多尝试一些事情怎么知道自己适合什么、不适合什么呢?\n你说你喜欢读书,让我给你列书单,你还问我哪里有那么多时间看书;你说自己梦想的职业是广告文案,问我如何成为一个文案,应该具备哪些素质;你说你计划晨跑,但总是因为学习、工作辛苦或者身体不舒服第二天起不了床;你说你一直梦想一个人去长途旅行,但是没钱,父母觉得危险。其实,我已经厌倦了你这样说说而已的把戏,我觉得就算我告诉你如何去做,你也不会照做,因为你根本什么都不做。'</span>,<span style="color:#aa1111">'upload/aboutus_picture1.jpg'</span>,<span style="color:#aa1111">'upload/aboutus_picture2.jpg'</span>,<span style="color:#aa1111">'upload/aboutus_picture3.jpg'</span>);
<span style="color:#aa5500">/*!40000 ALTER TABLE `aboutus` ENABLE KEYS */</span>;
UNLOCK TABLES;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `config`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `config`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `config` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`name` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">100</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'配置参数名称'</span>,
`value` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">100</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'配置参数值'</span>,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=<span style="color:#116644">4</span> DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'配置文件'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Dumping data for table `config`</span>
<span style="color:#aa5500">--</span>
LOCK TABLES `config` WRITE;
<span style="color:#aa5500">/*!40000 ALTER TABLE `config` DISABLE KEYS */</span>;
<span style="color:#770088">INSERT</span> <span style="color:#770088">INTO</span> `config` <span style="color:#770088">VALUES</span> (<span style="color:#116644">1</span>,<span style="color:#aa1111">'picture1'</span>,<span style="color:#aa1111">'upload/picture1.jpg'</span>),(<span style="color:#116644">2</span>,<span style="color:#aa1111">'picture2'</span>,<span style="color:#aa1111">'upload/picture2.jpg'</span>),(<span style="color:#116644">3</span>,<span style="color:#aa1111">'picture3'</span>,<span style="color:#aa1111">'upload/picture3.jpg'</span>);
<span style="color:#aa5500">/*!40000 ALTER TABLE `config` ENABLE KEYS */</span>;
UNLOCK TABLES;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `discussjiaoyuan`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `discussjiaoyuan`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `discussjiaoyuan` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`addtime` <span style="color:#3300aa">timestamp</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> DEFAULT CURRENT_TIMESTAMP COMMENT <span style="color:#aa1111">'创建时间'</span>,
`refid` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'关联表id'</span>,
`userid` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'用户id'</span>,
`avatarurl` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'头像'</span>,
`nickname` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'用户名'</span>,
`content` <span style="color:#3300aa">longtext</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'评论内容'</span>,
`reply` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'回复内容'</span>,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'教员评论表'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Dumping data for table `discussjiaoyuan`</span>
<span style="color:#aa5500">--</span>
LOCK TABLES `discussjiaoyuan` WRITE;
<span style="color:#aa5500">/*!40000 ALTER TABLE `discussjiaoyuan` DISABLE KEYS */</span>;
<span style="color:#aa5500">/*!40000 ALTER TABLE `discussjiaoyuan` ENABLE KEYS */</span>;
UNLOCK TABLES;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `discusszhaopinxinxi`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `discusszhaopinxinxi`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `discusszhaopinxinxi` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`addtime` <span style="color:#3300aa">timestamp</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> DEFAULT CURRENT_TIMESTAMP COMMENT <span style="color:#aa1111">'创建时间'</span>,
`refid` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'关联表id'</span>,
`userid` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'用户id'</span>,
`avatarurl` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'头像'</span>,
`nickname` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'用户名'</span>,
`content` <span style="color:#3300aa">longtext</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'评论内容'</span>,
`reply` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'回复内容'</span>,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'招聘信息评论表'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Dumping data for table `discusszhaopinxinxi`</span>
<span style="color:#aa5500">--</span>
LOCK TABLES `discusszhaopinxinxi` WRITE;
<span style="color:#aa5500">/*!40000 ALTER TABLE `discusszhaopinxinxi` DISABLE KEYS */</span>;
<span style="color:#aa5500">/*!40000 ALTER TABLE `discusszhaopinxinxi` ENABLE KEYS */</span>;
UNLOCK TABLES;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `jiajiaoshenqing`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `jiajiaoshenqing`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `jiajiaoshenqing` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`addtime` <span style="color:#3300aa">timestamp</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> DEFAULT CURRENT_TIMESTAMP COMMENT <span style="color:#aa1111">'创建时间'</span>,
`shenqingbianhao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'申请编号'</span>,
`gonghao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'工号'</span>,
`jiaoshixingming` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'教师姓名'</span>,
`shoukezhuanye` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'授课专业'</span>,
`xueli` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'学历'</span>,
`jiajiaofeiyong` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'家教费用'</span>,
`shenqingriqi` <span style="color:#3300aa">date</span> DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'申请日期'</span>,
`shenqingneirong` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'申请内容'</span>,
`zhanghao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'账号'</span>,
`xingming` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'姓名'</span>,
`shoujihaoma` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'手机号码'</span>,
`sfsh` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#aa1111">'待审核'</span> COMMENT <span style="color:#aa1111">'是否审核'</span>,
`shhf` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'审核回复'</span>,
PRIMARY KEY (`id`),
UNIQUE KEY `shenqingbianhao` (`shenqingbianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=<span style="color:#116644">59</span> DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'家教申请'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Dumping data for table `jiajiaoshenqing`</span>
<span style="color:#aa5500">--</span>
LOCK TABLES `jiajiaoshenqing` WRITE;
<span style="color:#aa5500">/*!40000 ALTER TABLE `jiajiaoshenqing` DISABLE KEYS */</span>;
<span style="color:#770088">INSERT</span> <span style="color:#770088">INTO</span> `jiajiaoshenqing` <span style="color:#770088">VALUES</span> (<span style="color:#116644">51</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'1111111111'</span>,<span style="color:#aa1111">'工号1'</span>,<span style="color:#aa1111">'教师姓名1'</span>,<span style="color:#aa1111">'授课专业1'</span>,<span style="color:#aa1111">'学历1'</span>,<span style="color:#aa1111">'家教费用1'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容1'</span>,<span style="color:#aa1111">'账号1'</span>,<span style="color:#aa1111">'姓名1'</span>,<span style="color:#aa1111">'手机号码1'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">52</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'2222222222'</span>,<span style="color:#aa1111">'工号2'</span>,<span style="color:#aa1111">'教师姓名2'</span>,<span style="color:#aa1111">'授课专业2'</span>,<span style="color:#aa1111">'学历2'</span>,<span style="color:#aa1111">'家教费用2'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容2'</span>,<span style="color:#aa1111">'账号2'</span>,<span style="color:#aa1111">'姓名2'</span>,<span style="color:#aa1111">'手机号码2'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">53</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'3333333333'</span>,<span style="color:#aa1111">'工号3'</span>,<span style="color:#aa1111">'教师姓名3'</span>,<span style="color:#aa1111">'授课专业3'</span>,<span style="color:#aa1111">'学历3'</span>,<span style="color:#aa1111">'家教费用3'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容3'</span>,<span style="color:#aa1111">'账号3'</span>,<span style="color:#aa1111">'姓名3'</span>,<span style="color:#aa1111">'手机号码3'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">54</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'4444444444'</span>,<span style="color:#aa1111">'工号4'</span>,<span style="color:#aa1111">'教师姓名4'</span>,<span style="color:#aa1111">'授课专业4'</span>,<span style="color:#aa1111">'学历4'</span>,<span style="color:#aa1111">'家教费用4'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容4'</span>,<span style="color:#aa1111">'账号4'</span>,<span style="color:#aa1111">'姓名4'</span>,<span style="color:#aa1111">'手机号码4'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">55</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'5555555555'</span>,<span style="color:#aa1111">'工号5'</span>,<span style="color:#aa1111">'教师姓名5'</span>,<span style="color:#aa1111">'授课专业5'</span>,<span style="color:#aa1111">'学历5'</span>,<span style="color:#aa1111">'家教费用5'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容5'</span>,<span style="color:#aa1111">'账号5'</span>,<span style="color:#aa1111">'姓名5'</span>,<span style="color:#aa1111">'手机号码5'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">56</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'6666666666'</span>,<span style="color:#aa1111">'工号6'</span>,<span style="color:#aa1111">'教师姓名6'</span>,<span style="color:#aa1111">'授课专业6'</span>,<span style="color:#aa1111">'学历6'</span>,<span style="color:#aa1111">'家教费用6'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容6'</span>,<span style="color:#aa1111">'账号6'</span>,<span style="color:#aa1111">'姓名6'</span>,<span style="color:#aa1111">'手机号码6'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">57</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'7777777777'</span>,<span style="color:#aa1111">'工号7'</span>,<span style="color:#aa1111">'教师姓名7'</span>,<span style="color:#aa1111">'授课专业7'</span>,<span style="color:#aa1111">'学历7'</span>,<span style="color:#aa1111">'家教费用7'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容7'</span>,<span style="color:#aa1111">'账号7'</span>,<span style="color:#aa1111">'姓名7'</span>,<span style="color:#aa1111">'手机号码7'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">58</span>,<span style="color:#aa1111">'2023-03-05 09:51:24'</span>,<span style="color:#aa1111">'8888888888'</span>,<span style="color:#aa1111">'工号8'</span>,<span style="color:#aa1111">'教师姓名8'</span>,<span style="color:#aa1111">'授课专业8'</span>,<span style="color:#aa1111">'学历8'</span>,<span style="color:#aa1111">'家教费用8'</span>,<span style="color:#aa1111">'2023-03-05'</span>,<span style="color:#aa1111">'申请内容8'</span>,<span style="color:#aa1111">'账号8'</span>,<span style="color:#aa1111">'姓名8'</span>,<span style="color:#aa1111">'手机号码8'</span>,<span style="color:#aa1111">'是'</span>,<span style="color:#aa1111">''</span>);
<span style="color:#aa5500">/*!40000 ALTER TABLE `jiajiaoshenqing` ENABLE KEYS */</span>;
UNLOCK TABLES;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `jiaoyuan`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `jiaoyuan`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `jiaoyuan` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`addtime` <span style="color:#3300aa">timestamp</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> DEFAULT CURRENT_TIMESTAMP COMMENT <span style="color:#aa1111">'创建时间'</span>,
`gonghao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'工号'</span>,
`mima` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'密码'</span>,
`jiaoshixingming` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'教师姓名'</span>,
`xingbie` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'性别'</span>,
`youxiang` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'邮箱'</span>,
`lianxishouji` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'联系手机'</span>,
`shoukezhuanye` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'授课专业'</span>,
`xueli` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'学历'</span>,
`touxiang` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'头像'</span>,
`jiajiaofeiyong` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'家教费用'</span>,
`gerenjianjie` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'个人简介'</span>,
`rongyuxinxi` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'荣誉信息'</span>,
PRIMARY KEY (`id`),
UNIQUE KEY `gonghao` (`gonghao`)
) ENGINE=InnoDB AUTO_INCREMENT=<span style="color:#116644">29</span> DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'教员'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `jiaoyuanfankui`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `jiaoyuanfankui`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `jiaoyuanfankui` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`addtime` <span style="color:#3300aa">timestamp</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> DEFAULT CURRENT_TIMESTAMP COMMENT <span style="color:#aa1111">'创建时间'</span>,
`fankuibianhao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'反馈编号'</span>,
`fankuibiaoti` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'反馈标题'</span>,
`fankuineirong` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'反馈内容'</span>,
`fankuishijian` <span style="color:#3300aa">datetime</span> DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'反馈时间'</span>,
`gonghao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'工号'</span>,
`jiaoshixingming` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'教师姓名'</span>,
`shhf` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'回复内容'</span>,
PRIMARY KEY (`id`),
UNIQUE KEY `fankuibianhao` (`fankuibianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=<span style="color:#116644">119</span> DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'教员反馈'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Dumping data for table `jiaoyuanfankui`</span>
<span style="color:#aa5500">--</span>
LOCK TABLES `jiaoyuanfankui` WRITE;
<span style="color:#aa5500">/*!40000 ALTER TABLE `jiaoyuanfankui` DISABLE KEYS */</span>;
<span style="color:#770088">INSERT</span> <span style="color:#770088">INTO</span> `jiaoyuanfankui` <span style="color:#770088">VALUES</span> (<span style="color:#116644">111</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'1111111111'</span>,<span style="color:#aa1111">'反馈标题1'</span>,<span style="color:#aa1111">'反馈内容1'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号1'</span>,<span style="color:#aa1111">'教师姓名1'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">112</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'2222222222'</span>,<span style="color:#aa1111">'反馈标题2'</span>,<span style="color:#aa1111">'反馈内容2'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号2'</span>,<span style="color:#aa1111">'教师姓名2'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">113</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'3333333333'</span>,<span style="color:#aa1111">'反馈标题3'</span>,<span style="color:#aa1111">'反馈内容3'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号3'</span>,<span style="color:#aa1111">'教师姓名3'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">114</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'4444444444'</span>,<span style="color:#aa1111">'反馈标题4'</span>,<span style="color:#aa1111">'反馈内容4'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号4'</span>,<span style="color:#aa1111">'教师姓名4'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">115</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'5555555555'</span>,<span style="color:#aa1111">'反馈标题5'</span>,<span style="color:#aa1111">'反馈内容5'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号5'</span>,<span style="color:#aa1111">'教师姓名5'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">116</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'6666666666'</span>,<span style="color:#aa1111">'反馈标题6'</span>,<span style="color:#aa1111">'反馈内容6'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号6'</span>,<span style="color:#aa1111">'教师姓名6'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">117</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'7777777777'</span>,<span style="color:#aa1111">'反馈标题7'</span>,<span style="color:#aa1111">'反馈内容7'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号7'</span>,<span style="color:#aa1111">'教师姓名7'</span>,<span style="color:#aa1111">''</span>),(<span style="color:#116644">118</span>,<span style="color:#aa1111">'2023-03-05 09:51:25'</span>,<span style="color:#aa1111">'8888888888'</span>,<span style="color:#aa1111">'反馈标题8'</span>,<span style="color:#aa1111">'反馈内容8'</span>,<span style="color:#aa1111">'2023-03-05 17:51:25'</span>,<span style="color:#aa1111">'工号8'</span>,<span style="color:#aa1111">'教师姓名8'</span>,<span style="color:#aa1111">''</span>);
<span style="color:#aa5500">/*!40000 ALTER TABLE `jiaoyuanfankui` ENABLE KEYS */</span>;
UNLOCK TABLES;
<span style="color:#aa5500">--</span>
<span style="color:#aa5500">-- Table structure for table `ketijiangjie`</span>
<span style="color:#aa5500">--</span>
<span style="color:#770088">DROP</span> <span style="color:#770088">TABLE</span> IF EXISTS `ketijiangjie`;
<span style="color:#aa5500">/*!40101 SET @saved_cs_client = @@character_set_client */</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = utf8 */</span>;
<span style="color:#770088">CREATE</span> <span style="color:#770088">TABLE</span> `ketijiangjie` (
`id` <span style="color:#3300aa">bigint</span>(<span style="color:#116644">20</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> AUTO_INCREMENT COMMENT <span style="color:#aa1111">'主键'</span>,
`addtime` <span style="color:#3300aa">timestamp</span> <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> DEFAULT CURRENT_TIMESTAMP COMMENT <span style="color:#aa1111">'创建时间'</span>,
`gonghao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'工号'</span>,
`jiaoshixingming` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'教师姓名'</span>,
`xueli` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'学历'</span>,
`yuyueshijian` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) <span style="color:#770088">NOT</span> <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'预约时间'</span>,
`ketimingcheng` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'课题名称'</span>,
`jiangjieshipin` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'讲解视频'</span>,
`dizhi` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'地址'</span>,
`zhanghao` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'账号'</span>,
`xingming` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'姓名'</span>,
`shoujihaoma` <span style="color:#3300aa">varchar</span>(<span style="color:#116644">200</span>) DEFAULT <span style="color:#221199">NULL</span> COMMENT <span style="color:#aa1111">'手机号码'</span>,
`neirong` <span style="color:#3300aa">longtext</span> COMMENT <span style="color:#aa1111">'内容'</span>,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=<span style="color:#116644">79</span> DEFAULT CHARSET=utf8 COMMENT=<span style="color:#aa1111">'课题讲解'</span>;
<span style="color:#aa5500">/*!40101 SET character_set_client = @saved_cs_client */</span>;</span></span>
七、代码参考
<span style="background-color:#f8f8f8"><span style="color:#333333"><span style="color:#555555">@IgnoreAuth</span>
<span style="color:#555555">@PostMapping</span>(<span style="color:#000000">value</span> <span style="color:#981a1a">=</span> <span style="color:#aa1111">"/login"</span>)
<span style="color:#770088">public</span> <span style="color:#000000">R</span> <span style="color:#0000ff">login</span>(<span style="color:#008855">String</span> <span style="color:#000000">username</span>, <span style="color:#008855">String</span> <span style="color:#000000">password</span>, <span style="color:#008855">String</span> <span style="color:#000000">captcha</span>, <span style="color:#000000">HttpServletRequest</span> <span style="color:#000000">request</span>) {
<span style="color:#000000">UsersEntity</span> <span style="color:#000000">user</span> <span style="color:#981a1a">=</span> <span style="color:#000000">userService</span>.<span style="color:#000000">selectOne</span>(<span style="color:#770088">new</span> <span style="color:#000000">EntityWrapper</span><span style="color:#981a1a"><</span><span style="color:#000000">UsersEntity</span><span style="color:#981a1a">></span>().<span style="color:#000000">eq</span>(<span style="color:#aa1111">"username"</span>, <span style="color:#000000">username</span>));
<span style="color:#770088">if</span>(<span style="color:#000000">user</span><span style="color:#981a1a">==</span><span style="color:#221199">null</span> <span style="color:#981a1a">||</span> <span style="color:#981a1a">!</span><span style="color:#000000">user</span>.<span style="color:#000000">getPassword</span>().<span style="color:#000000">equals</span>(<span style="color:#000000">password</span>)) {
<span style="color:#770088">return</span> <span style="color:#000000">R</span>.<span style="color:#000000">error</span>(<span style="color:#aa1111">"账号或密码不正确"</span>);
}
<span style="color:#008855">String</span> <span style="color:#000000">token</span> <span style="color:#981a1a">=</span> <span style="color:#000000">tokenService</span>.<span style="color:#000000">generateToken</span>(<span style="color:#000000">user</span>.<span style="color:#000000">getId</span>(),<span style="color:#000000">username</span>, <span style="color:#aa1111">"users"</span>, <span style="color:#000000">user</span>.<span style="color:#000000">getRole</span>());
<span style="color:#770088">return</span> <span style="color:#000000">R</span>.<span style="color:#000000">ok</span>().<span style="color:#000000">put</span>(<span style="color:#aa1111">"token"</span>, <span style="color:#000000">token</span>);
}
<span style="color:#555555">@Override</span>
<span style="color:#770088">public</span> <span style="color:#008855">String</span> <span style="color:#0000ff">generateToken</span>(<span style="color:#008855">Long</span> <span style="color:#000000">userid</span>,<span style="color:#008855">String</span> <span style="color:#000000">username</span>, <span style="color:#008855">String</span> <span style="color:#000000">tableName</span>, <span style="color:#008855">String</span> <span style="color:#000000">role</span>) {
<span style="color:#000000">TokenEntity</span> <span style="color:#000000">tokenEntity</span> <span style="color:#981a1a">=</span> <span style="color:#770088">this</span>.<span style="color:#000000">selectOne</span>(<span style="color:#770088">new</span> <span style="color:#000000">EntityWrapper</span><span style="color:#981a1a"><</span><span style="color:#000000">TokenEntity</span><span style="color:#981a1a">></span>().<span style="color:#000000">eq</span>(<span style="color:#aa1111">"userid"</span>, <span style="color:#000000">userid</span>).<span style="color:#000000">eq</span>(<span style="color:#aa1111">"role"</span>, <span style="color:#000000">role</span>));
<span style="color:#008855">String</span> <span style="color:#000000">token</span> <span style="color:#981a1a">=</span> <span style="color:#000000">CommonUtil</span>.<span style="color:#000000">getRandomString</span>(<span style="color:#116644">32</span>);
<span style="color:#000000">Calendar</span> <span style="color:#000000">cal</span> <span style="color:#981a1a">=</span> <span style="color:#000000">Calendar</span>.<span style="color:#000000">getInstance</span>();
<span style="color:#000000">cal</span>.<span style="color:#000000">setTime</span>(<span style="color:#770088">new</span> <span style="color:#000000">Date</span>());
<span style="color:#000000">cal</span>.<span style="color:#000000">add</span>(<span style="color:#000000">Calendar</span>.<span style="color:#000000">HOUR_OF_DAY</span>, <span style="color:#116644">1</span>);
<span style="color:#770088">if</span>(<span style="color:#000000">tokenEntity</span><span style="color:#981a1a">!=</span><span style="color:#221199">null</span>) {
<span style="color:#000000">tokenEntity</span>.<span style="color:#000000">setToken</span>(<span style="color:#000000">token</span>);
<span style="color:#000000">tokenEntity</span>.<span style="color:#000000">setExpiratedtime</span>(<span style="color:#000000">cal</span>.<span style="color:#000000">getTime</span>());
<span style="color:#770088">this</span>.<span style="color:#000000">updateById</span>(<span style="color:#000000">tokenEntity</span>);
} <span style="color:#770088">else</span> {
<span style="color:#770088">this</span>.<span style="color:#000000">insert</span>(<span style="color:#770088">new</span> <span style="color:#000000">TokenEntity</span>(<span style="color:#000000">userid</span>,<span style="color:#000000">username</span>, <span style="color:#000000">tableName</span>, <span style="color:#000000">role</span>, <span style="color:#000000">token</span>, <span style="color:#000000">cal</span>.<span style="color:#000000">getTime</span>()));
}
<span style="color:#770088">return</span> <span style="color:#000000">token</span>;
}
<span style="color:#aa5500">/**</span>
<span style="color:#aa5500">* 权限(Token)验证</span>
<span style="color:#aa5500">*/</span>
<span style="color:#555555">@Component</span>
<span style="color:#770088">public</span> <span style="color:#770088">class</span> <span style="color:#0000ff">AuthorizationInterceptor</span> <span style="color:#770088">implements</span> <span style="color:#000000">HandlerInterceptor</span> {
<span style="color:#770088">public</span> <span style="color:#770088">static</span> <span style="color:#770088">final</span> <span style="color:#008855">String</span> <span style="color:#000000">LOGIN_TOKEN_KEY</span> <span style="color:#981a1a">=</span> <span style="color:#aa1111">"Token"</span>;
<span style="color:#555555">@Autowired</span>
<span style="color:#770088">private</span> <span style="color:#000000">TokenService</span> <span style="color:#000000">tokenService</span>;
<span style="color:#555555">@Override</span>
<span style="color:#770088">public</span> <span style="color:#008855">boolean</span> <span style="color:#000000">preHandle</span>(<span style="color:#000000">HttpServletRequest</span> <span style="color:#000000">request</span>, <span style="color:#000000">HttpServletResponse</span> <span style="color:#000000">response</span>, <span style="color:#008855">Object</span> <span style="color:#000000">handler</span>) <span style="color:#770088">throws</span> <span style="color:#000000">Exception</span> {
<span style="color:#aa5500">//支持跨域请求</span>
<span style="color:#000000">response</span>.<span style="color:#000000">setHeader</span>(<span style="color:#aa1111">"Access-Control-Allow-Methods"</span>, <span style="color:#aa1111">"POST, GET, OPTIONS, DELETE"</span>);
<span style="color:#000000">response</span>.<span style="color:#000000">setHeader</span>(<span style="color:#aa1111">"Access-Control-Max-Age"</span>, <span style="color:#aa1111">"3600"</span>);
<span style="color:#000000">response</span>.<span style="color:#000000">setHeader</span>(<span style="color:#aa1111">"Access-Control-Allow-Credentials"</span>, <span style="color:#aa1111">"true"</span>);
<span style="color:#000000">response</span>.<span style="color:#000000">setHeader</span>(<span style="color:#aa1111">"Access-Control-Allow-Headers"</span>, <span style="color:#aa1111">"x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"</span>);
<span style="color:#000000">response</span>.<span style="color:#000000">setHeader</span>(<span style="color:#aa1111">"Access-Control-Allow-Origin"</span>, <span style="color:#000000">request</span>.<span style="color:#000000">getHeader</span>(<span style="color:#aa1111">"Origin"</span>));
<span style="color:#aa5500">// 跨域时会首先发送一个OPTIONS请求,这里我们给OPTIONS请求直接返回正常状态</span>
<span style="color:#770088">if</span> (<span style="color:#000000">request</span>.<span style="color:#000000">getMethod</span>().<span style="color:#000000">equals</span>(<span style="color:#000000">RequestMethod</span>.<span style="color:#000000">OPTIONS</span>.<span style="color:#000000">name</span>())) {
<span style="color:#000000">response</span>.<span style="color:#000000">setStatus</span>(<span style="color:#000000">HttpStatus</span>.<span style="color:#000000">OK</span>.<span style="color:#000000">value</span>());
<span style="color:#770088">return</span> <span style="color:#221199">false</span>;
}
<span style="color:#000000">IgnoreAuth</span> <span style="color:#000000">annotation</span>;
<span style="color:#770088">if</span> (<span style="color:#000000">handler</span> <span style="color:#770088">instanceof</span> <span style="color:#000000">HandlerMethod</span>) {
<span style="color:#000000">annotation</span> <span style="color:#981a1a">=</span> ((<span style="color:#000000">HandlerMethod</span>) <span style="color:#000000">handler</span>).<span style="color:#000000">getMethodAnnotation</span>(<span style="color:#000000">IgnoreAuth</span>.<span style="color:#770088">class</span>);
} <span style="color:#770088">else</span> {
<span style="color:#770088">return</span> <span style="color:#221199">true</span>;
}
<span style="color:#aa5500">//从header中获取token</span>
<span style="color:#008855">String</span> <span style="color:#000000">token</span> <span style="color:#981a1a">=</span> <span style="color:#000000">request</span>.<span style="color:#000000">getHeader</span>(<span style="color:#000000">LOGIN_TOKEN_KEY</span>);
<span style="color:#aa5500">/**</span>
<span style="color:#aa5500">* 不需要验证权限的方法直接放过</span>
<span style="color:#aa5500">*/</span>
<span style="color:#770088">if</span>(<span style="color:#000000">annotation</span><span style="color:#981a1a">!=</span><span style="color:#221199">null</span>) {
<span style="color:#770088">return</span> <span style="color:#221199">true</span>;
}
<span style="color:#000000">TokenEntity</span> <span style="color:#000000">tokenEntity</span> <span style="color:#981a1a">=</span> <span style="color:#221199">null</span>;
<span style="color:#770088">if</span>(<span style="color:#000000">StringUtils</span>.<span style="color:#000000">isNotBlank</span>(<span style="color:#000000">token</span>)) {
<span style="color:#000000">tokenEntity</span> <span style="color:#981a1a">=</span> <span style="color:#000000">tokenService</span>.<span style="color:#000000">getTokenEntity</span>(<span style="color:#000000">token</span>);
}
<span style="color:#770088">if</span>(<span style="color:#000000">tokenEntity</span> <span style="color:#981a1a">!=</span> <span style="color:#221199">null</span>) {
<span style="color:#000000">request</span>.<span style="color:#000000">getSession</span>().<span style="color:#000000">setAttribute</span>(<span style="color:#aa1111">"userId"</span>, <span style="color:#000000">tokenEntity</span>.<span style="color:#000000">getUserid</span>());
<span style="color:#000000">request</span>.<span style="color:#000000">getSession</span>().<span style="color:#000000">setAttribute</span>(<span style="color:#aa1111">"role"</span>, <span style="color:#000000">tokenEntity</span>.<span style="color:#000000">getRole</span>());
<span style="color:#000000">request</span>.<span style="color:#000000">getSession</span>().<span style="color:#000000">setAttribute</span>(<span style="color:#aa1111">"tableName"</span>, <span style="color:#000000">tokenEntity</span>.<span style="color:#000000">getTablename</span>());
<span style="color:#000000">request</span>.<span style="color:#000000">getSession</span>().<span style="color:#000000">setAttribute</span>(<span style="color:#aa1111">"username"</span>, <span style="color:#000000">tokenEntity</span>.<span style="color:#000000">getUsername</span>());
<span style="color:#770088">return</span> <span style="color:#221199">true</span>;
}
<span style="color:#000000">PrintWriter</span> <span style="color:#000000">writer</span> <span style="color:#981a1a">=</span> <span style="color:#221199">null</span>;
<span style="color:#000000">response</span>.<span style="color:#000000">setCharacterEncoding</span>(<span style="color:#aa1111">"UTF-8"</span>);
<span style="color:#000000">response</span>.<span style="color:#000000">setContentType</span>(<span style="color:#aa1111">"application/json; charset=utf-8"</span>);
<span style="color:#770088">try</span> {
<span style="color:#000000">writer</span> <span style="color:#981a1a">=</span> <span style="color:#000000">response</span>.<span style="color:#000000">getWriter</span>();
<span style="color:#000000">writer</span>.<span style="color:#000000">print</span>(<span style="color:#000000">JSONObject</span>.<span style="color:#000000">toJSONString</span>(<span style="color:#000000">R</span>.<span style="color:#000000">error</span>(<span style="color:#116644">401</span>, <span style="color:#aa1111">"请先登录"</span>)));
} <span style="color:#770088">finally</span> {
<span style="color:#770088">if</span>(<span style="color:#000000">writer</span> <span style="color:#981a1a">!=</span> <span style="color:#221199">null</span>){
<span style="color:#000000">writer</span>.<span style="color:#000000">close</span>();
}
}
<span style="color:#aa5500">// throw new EIException("请先登录", 401);</span>
<span style="color:#770088">return</span> <span style="color:#221199">false</span>;
}
}
</span></span>
四、源码获取
文章下方名片联系我即可~ 大家点赞、收藏、关注、评论啦 Java项目精品实战案例 微信小程序项目精品案例