Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cnooc_zydeepen-cggl_expert-manage-miniapp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
孙德龙
cnooc_zydeepen-cggl_expert-manage-miniapp
Commits
862ae7c0
Commit
862ae7c0
authored
Nov 14, 2025
by
weisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test redis and login
parent
c5492616
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
src/main/java/com/cnooc/expert/common/interceptor/LoginInterceptor.java
+1
-0
src/main/java/com/cnooc/expert/config/TheWebMvcConfigurer.java
+3
-1
src/main/java/com/cnooc/expert/controller/auth/LoginController.java
+2
-2
No files found.
src/main/java/com/cnooc/expert/common/interceptor/LoginInterceptor.java
View file @
862ae7c0
...
@@ -36,6 +36,7 @@ public class LoginInterceptor implements HandlerInterceptor {
...
@@ -36,6 +36,7 @@ public class LoginInterceptor implements HandlerInterceptor {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
String
token
=
request
.
getHeader
(
"Authorization"
);
String
token
=
request
.
getHeader
(
"Authorization"
);
log
.
info
(
"request uri :"
+
request
.
getRequestURI
());
if
(
token
==
null
||
token
.
trim
().
isEmpty
())
{
if
(
token
==
null
||
token
.
trim
().
isEmpty
())
{
response
.
setStatus
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
response
.
setStatus
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
throw
new
BusinessException
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
GlobalErrorCodeConstants
.
LOGIN_EXPIRED
.
getMsg
());
throw
new
BusinessException
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
GlobalErrorCodeConstants
.
LOGIN_EXPIRED
.
getMsg
());
...
...
src/main/java/com/cnooc/expert/config/TheWebMvcConfigurer.java
View file @
862ae7c0
...
@@ -24,7 +24,9 @@ public class TheWebMvcConfigurer implements WebMvcConfigurer {
...
@@ -24,7 +24,9 @@ public class TheWebMvcConfigurer implements WebMvcConfigurer {
"/sys/**"
,
"/sys/**"
,
"/verify/**"
,
"/verify/**"
,
"/person/**"
,
"/person/**"
,
"/text/**"
"/text/**"
,
"/error/**"
,
"/error"
);
);
registry
.
addInterceptor
(
webAuthInterceptor
());
registry
.
addInterceptor
(
webAuthInterceptor
());
...
...
src/main/java/com/cnooc/expert/controller/auth/LoginController.java
View file @
862ae7c0
package
com
.
cnooc
.
expert
.
controller
.
auth
;
package
com
.
cnooc
.
expert
.
controller
.
auth
;
import
com.cnooc.expert.auth.service.LoginService
;
import
com.cnooc.expert.auth.service.SysCaptchaService
;
import
com.cnooc.expert.auth.service.SysCaptchaService
;
import
com.cnooc.expert.common.response.ApiResult
;
import
com.cnooc.expert.common.response.ApiResult
;
import
com.cnooc.expert.auth.service.LoginService
;
import
com.cnooc.expert.system.entity.vo.LoginVO
;
import
com.cnooc.expert.system.entity.vo.LoginVO
;
import
com.cnooc.expert.system.entity.vo.SysCaptchaVO
;
import
com.cnooc.expert.system.entity.vo.SysCaptchaVO
;
import
com.cnooc.expert.system.entity.vo.VerifyCodeVO
;
import
com.cnooc.expert.system.entity.vo.VerifyCodeVO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -25,6 +24,7 @@ public class LoginController {
...
@@ -25,6 +24,7 @@ public class LoginController {
@Autowired
@Autowired
private
SysCaptchaService
sysCaptchaService
;
private
SysCaptchaService
sysCaptchaService
;
/**
/**
* 手机号验证码/身份证号密码 登录功能
* 手机号验证码/身份证号密码 登录功能
* @param loginVO 登录表单
* @param loginVO 登录表单
...
...
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