Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
c1880e95
Commit
c1880e95
authored
Nov 23, 2017
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充危险期log,恢复阈值设定
parent
14bec929
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
Constants.java
src/main/java/cn/quantgroup/xyqb/Constants.java
+3
-3
ValidationUtil.java
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
+5
-0
No files found.
src/main/java/cn/quantgroup/xyqb/Constants.java
View file @
c1880e95
...
...
@@ -39,10 +39,10 @@ public interface Constants {
String
REDIS_PASSWORD_ERROR_COUNT
=
"password_error_count:"
;
String
REDIS_PASSWORD_ERROR_COUNT_FOR_IPV4
=
"password_error_count_4_ipv4:"
;
String
IPV4_LOCK
=
"lock_ipv4:"
;
final
Long
IPV4_LOCK_MINUTES
=
6
*
60L
;
final
Long
IPV4_LOCK_MINUTES
=
6
*
60L
;
//3L;//6 * 60L;
final
Long
IPV4_COUNT_MINUTES
=
1L
;
final
Long
IPV4_LOCK_ON_COUNTS
=
5L
;
//60L;
final
int
DANGEROUS_TIME_START
=
20
;
//22;
final
Long
IPV4_LOCK_ON_COUNTS
=
60L
;
//
5L;//60L;
final
int
DANGEROUS_TIME_START
=
2
3
;
//2
0;//22;
final
int
DANGEROUS_TIME_END
=
6
;
/**
* redis中token的key值前缀
...
...
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
View file @
c1880e95
package
cn
.
quantgroup
.
xyqb
.
util
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.controller.internal.user.UserController
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.Calendar
;
import
java.util.regex.Matcher
;
...
...
@@ -13,6 +16,7 @@ import java.util.regex.Pattern;
*/
public
class
ValidationUtil
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
UserController
.
class
);
private
static
String
phoneRegExp
=
"^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$"
;
private
static
String
chineseNameRegExp
=
"^[\u4e00-\u9fa5]+(\\.|·)?[\u4e00-\u9fa5]+$"
;
private
static
String
ipv4RegExp
=
"^((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)\\.){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)$"
;
...
...
@@ -59,6 +63,7 @@ public class ValidationUtil {
public
static
boolean
isAtDangerousTime
()
{
Calendar
now
=
Calendar
.
getInstance
();
int
hour
=
now
.
get
(
Calendar
.
HOUR_OF_DAY
);
LOGGER
.
info
(
"当前时间为:{}点,危险期范围:{}点至{}点"
,
hour
,
Constants
.
DANGEROUS_TIME_START
,
Constants
.
DANGEROUS_TIME_END
);
return
Constants
.
DANGEROUS_TIME_START
<=
hour
||
hour
<
Constants
.
DANGEROUS_TIME_END
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment