Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
4e8c7e8b
Commit
4e8c7e8b
authored
Jan 28, 2026
by
王蔡翾
Browse files
配置和白名单调整
parent
52a2ed3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
4e8c7e8b
...
...
@@ -117,7 +117,7 @@
<dependency>
<groupId>
com.ruzhoukj
</groupId>
<artifactId>
common-core
</artifactId>
<version>
1.0.
4
</version>
<version>
1.0.
5
</version>
</dependency>
<!-- 阿里云oss-->
...
...
src/main/java/com/ruzhoukj/sms/filter/JwtAuthFilter.java
View file @
4e8c7e8b
...
...
@@ -32,7 +32,8 @@ public class JwtAuthFilter extends OncePerRequestFilter implements Ordered {
// 定义开放接口路径(支持通配符)
private
static
final
List
<
String
>
OPEN_API_PATHS
=
Arrays
.
asList
(
"/user/login"
"/login"
,
"/ragas/save"
);
@Override
...
...
src/main/java/com/ruzhoukj/sms/service/impl/LoginServiceImpl.java
View file @
4e8c7e8b
...
...
@@ -6,6 +6,7 @@ import com.ruzhoukj.sms.entity.LoginEntity;
import
com.ruzhoukj.sms.entity.UserEntity
;
import
com.ruzhoukj.sms.service.LoginService
;
import
com.ruzhoukj.sms.util.JwtUtil
;
import
org.springframework.security.authentication.BadCredentialsException
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -19,7 +20,8 @@ public class LoginServiceImpl extends ServiceImpl<UserDao, UserEntity> implement
// 根据用户名查询用户信息
UserEntity
user
=
baseMapper
.
getUserByUsernameAndPassword
(
login
.
getName
(),
login
.
getPassword
());
if
(
user
==
null
)
{
throw
new
RuntimeException
(
"用户名或者密码错误"
);
// log.error("用户名或密码错误");
throw
new
BadCredentialsException
(
"用户名或密码错误"
);
}
// 4. 生成 JWT Token
String
token
=
jwtUtil
.
generateToken
(
String
.
valueOf
(
user
.
getId
()),
user
.
getName
());
...
...
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