Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
d8542e2b
Commit
d8542e2b
authored
Jul 18, 2023
by
黄智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录调整
parent
6610b00d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/controller/login.go
src/controller/login.go
+4
-4
No files found.
src/controller/login.go
View file @
d8542e2b
...
@@ -63,7 +63,7 @@ func UserLoginV2(c *gin.Context) {
...
@@ -63,7 +63,7 @@ func UserLoginV2(c *gin.Context) {
}
}
loginInf
.
UserUnLock
(
userInfo
.
Id
)
loginInf
.
UserUnLock
(
userInfo
.
Id
)
//
TODO STEP2
用户和ip没有加入到访问规则登录不上提醒
//用户和ip没有加入到访问规则登录不上提醒
if
config
.
AccessRuleState
==
1
{
if
config
.
AccessRuleState
==
1
{
ip
:=
util
.
RemoteIp
(
c
.
Request
)
ip
:=
util
.
RemoteIp
(
c
.
Request
)
svc
:=
service
.
AccessRuleSvc
{}
svc
:=
service
.
AccessRuleSvc
{}
...
@@ -212,7 +212,7 @@ func UserPhoneLogin(c *gin.Context) {
...
@@ -212,7 +212,7 @@ func UserPhoneLogin(c *gin.Context) {
return
return
}
}
//
TODO STEP2
用户和ip没有加入到访问规则登录不上提醒
// 用户和ip没有加入到访问规则登录不上提醒
if
config
.
AccessRuleState
==
1
{
if
config
.
AccessRuleState
==
1
{
ip
:=
util
.
RemoteIp
(
c
.
Request
)
ip
:=
util
.
RemoteIp
(
c
.
Request
)
svc
:=
service
.
AccessRuleSvc
{}
svc
:=
service
.
AccessRuleSvc
{}
...
@@ -222,13 +222,13 @@ func UserPhoneLogin(c *gin.Context) {
...
@@ -222,13 +222,13 @@ func UserPhoneLogin(c *gin.Context) {
}
}
}
}
//
TODO STEP3
密码强弱提醒
// 密码强弱提醒
// 密码强弱提醒
// 密码强弱提醒
if
config
.
ForceUpdateState
==
1
&&
config
.
MinPwdLevel
>
userInfo
.
PwdLevel
{
if
config
.
ForceUpdateState
==
1
&&
config
.
MinPwdLevel
>
userInfo
.
PwdLevel
{
SendJsonResponse
(
c
,
resp
.
FAIL
.
ErrorDetail
(
errors
.
New
(
"密码强度弱,请联系管理员修改密码!"
)),
nil
)
SendJsonResponse
(
c
,
resp
.
FAIL
.
ErrorDetail
(
errors
.
New
(
"密码强度弱,请联系管理员修改密码!"
)),
nil
)
return
return
}
}
//
TODO STEP4
验证码正确性校验
// 验证码正确性校验
exist
,
err
:=
loginInf
.
VerifyPhoneCode
(
req
.
Phone
)
exist
,
err
:=
loginInf
.
VerifyPhoneCode
(
req
.
Phone
)
if
err
!=
nil
{
if
err
!=
nil
{
SendJsonResponse
(
c
,
resp
.
FAIL
.
ErrorDetail
(
err
),
nil
)
SendJsonResponse
(
c
,
resp
.
FAIL
.
ErrorDetail
(
err
),
nil
)
...
...
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