当前位置:网站首页>2022-2-14 learning xiangniuke project - section 23, section 5, development login and exit functions
2022-2-14 learning xiangniuke project - section 23, section 5, development login and exit functions
2022-07-02 05:28:00 【weixin_ thirty-seven million six hundred and eighty-two thousan】

login_ticket Structure , among ticket It's important
status 0 Indicates valid ,1 Indicates expiration

newly build LoginTicket The entity class 
Dao Layer of mapper
Inject a string , Return to one LoginTicket Entity class
LoginTicket selectByTicket(String ticket);
Insert a... Into the database loginTicket Entity class ,
int insertLoginTicket(LoginTicket loginTicket);
When the user exits or expires , take ticket The status of is changed to inactive
int updateStatus(String ticket, int status);
Write with notes sql sentence 
Generate primary key automatically 
mappertest test 
Successfully inserted 
test select and update
success 
service Layer writes the logic of user login 
Handle null values 
Verify whether the account does not exist , Or the account is not activated 
Verify password , Be careful md5 As long as the input values are the same , It turns out the same thing
What is stored in the database is md5 Calculated password 
Instantiation loginticket, And put in mapper

Util Of constant Two interfaces are set expired time, One general one , A tick to remember my 
Inject context-path

Check whether the verification code matches session The same in
If the verification code is empty , Or pass in the comparison code It's empty , Or the verification code is not equal to code, The output “ The verification code is wrong ”, And jump to the login page 
Define the expiration time , To check remmeber me Subject to 
Check the account number , password , call service Login of layer 
modify login.html,requestmapping Will go to controller lookup , Would call /login Of post Method 
to username,password Wait for name, Want to be with controller The parameter names of the methods in are consistent


Verification Code 
Remember me 
After processing login failure ,param yes Thymeleaf Treatment mode , You can get the parameters of the original method 
Dealing with passwords 
Handle and remember me 
The page after processing login failure displays
Wrong account number , Depending on usernameMsg Is it empty 
Empathy , Dealing with passwords 
Process verification code 
controller Of codeMsg And the following UsernameMsg and PasswordMsg
Test login page 
After outputting the correct verification code 

Enter the correct verification code and account number , Successful jump 
loginticket in 
The business layer , Pass on ticket, Set the account status to 1( Quit immediately )
Set exit path 
Test exit login 
You can see status Turn into 1, success 
边栏推荐
- 7.1模拟赛总结
- Fabric. JS basic brush
- Storage of data
- Global and Chinese market of hydrocyclone desander 2022-2028: Research Report on technology, participants, trends, market size and share
- 延时队列两种实现方式
- Visual studio import
- Mysql基础---查询(1天学会mysql基础)
- 青训营--数据库实操项目
- Global and Chinese market of cell culture freezers 2022-2028: Research Report on technology, participants, trends, market size and share
- Leetcode18题 【四数之和】递归解法
猜你喜欢

kmp思想及模板代码

黑马笔记---Set系列集合

6.网络-基础

4. Flask cooperates with a tag to link internal routes

7. Eleven state sets of TCP

Gee series: Unit 3 raster remote sensing image band characteristics and rendering visualization

Centos8 installation mysql8.0.22 tutorial

Using Kube bench and Kube hunter to evaluate the risk of kubernetes cluster

Disable access to external entities in XML parsing

KMP idea and template code
随机推荐
Gee series: Unit 3 raster remote sensing image band characteristics and rendering visualization
ERP management system development and design existing source code
Innovation never stops -- the innovation process of nvisual network visualization platform for Excel import
Gee series: Unit 1 Introduction to Google Earth engine
Straighten elements (with transition animation)
Creation and destruction of function stack frames
Gee: create a new feature and set corresponding attributes
Brew install * failed, solution
Global and Chinese market of hydrocyclone desander 2022-2028: Research Report on technology, participants, trends, market size and share
记录sentry的踩坑之路
来啦~ 使用 EasyExcel 导出时进行数据转换系列新篇章!
Nodejs (03) -- custom module
【pyinstaller】_ get_ sysconfigdata_ name() missing 1 required positional argument: ‘check_ exists‘
Gee series: unit 8 time series analysis in Google Earth engine [time series]
Gee data set: export the distribution and installed capacity of hydropower stations in the country to CSV table
7.1 Résumé du concours de simulation
Collectors.groupingBy 排序
Fabric.js 自由绘制矩形
kmp思想及模板代码
LeetCode 241. 为运算表达式设计优先级(分治/记忆化递归/动态规划)