当前位置:网站首页>Sliding validation tool class

Sliding validation tool class

2022-06-21 14:01:00 Funny 2233

Recently, I want to implement a sliding verification code , But I didn't find anything very useful , I wrote one myself

The main idea is to dynamically generate pictures in the background , And store the offset value , Easy to verify , It is similar to the self-defined picture verification code . Stored in seeeion in , You can also verify at the time of submission .
I wrote two editions of the same , A common version Maven edition , Easy to use , First edition spring-boot-starter Convenience and SpringBoot Use a combination of .

Project objectives

Slide verification code Write your own Use session Storage Tool class Every time Random Various information can be set
Develop tool classes first Redevelopment SpringBootStarter
Set picture size And Slider size
Background image location Slider picture position
watermark Content ( It can be changed ) size text color ( It can be changed )
Interference term number ( It can be changed )
Optimize Based on slider Part of the judgment required
SpringBootStarter Unique
Accuracy adjustment
Easy to use Canvas Implementation verification

Project effect

Introduce dependencies , Write the configuration , The actual configuration does not require how to write the default values, and most of them are sufficient , Basic filling
 Insert picture description here
The picture size should be consistent with the setting , So you don't have to adjust it automatically
Related resources
 Insert picture description here
Use effect
 Insert picture description here
Because my front end is not very good , Use here Canvas Test done
The main use of 3 individual api, these API All are provided by default

name effect
/slider/bg Used to get the background picture
/slider/slider Used to get the slider picture , It will automatically expand the height to match the background image
/slider/check?pos=${offset} Enter the current offset for background verification

Maven Project address :https://gitee.com/shaokang123/sliding-verification-code
spring-boot-starter Project address :https://gitee.com/shaokang123/slider-validation-spring-boot-starter

原网站

版权声明
本文为[Funny 2233]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221430106578.html