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
d895b93e
Commit
d895b93e
authored
Nov 14, 2025
by
刘红梅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改异常
parent
c5492616
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/main/java/com/cnooc/expert/auth/service/impl/LoginServiceImpl.java
+4
-2
No files found.
src/main/java/com/cnooc/expert/auth/service/impl/LoginServiceImpl.java
View file @
d895b93e
...
@@ -4,6 +4,7 @@ import cn.hutool.core.lang.Validator;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.lang.Validator;
import
cn.hutool.core.util.IdcardUtil
;
import
cn.hutool.core.util.IdcardUtil
;
import
com.cnooc.expert.common.constant.TokenConstants
;
import
com.cnooc.expert.common.constant.TokenConstants
;
import
com.cnooc.expert.common.exception.BusinessException
;
import
com.cnooc.expert.common.exception.BusinessException
;
import
com.cnooc.expert.common.exception.GlobalErrorCodeConstants
;
import
com.cnooc.expert.common.utils.JwtUtils
;
import
com.cnooc.expert.common.utils.JwtUtils
;
import
com.cnooc.expert.common.utils.Sm2Util
;
import
com.cnooc.expert.common.utils.Sm2Util
;
import
com.cnooc.expert.common.utils.ValidUtils
;
import
com.cnooc.expert.common.utils.ValidUtils
;
...
@@ -64,6 +65,7 @@ public class LoginServiceImpl implements LoginService {
...
@@ -64,6 +65,7 @@ public class LoginServiceImpl implements LoginService {
@Override
@Override
public
String
login
(
LoginVO
loginVO
)
{
public
String
login
(
LoginVO
loginVO
)
{
log
.
info
(
"开始执行登录逻辑"
);
log
.
info
(
"开始执行登录逻辑"
);
ValidUtils
.
isNotNull
(
loginVO
.
getLoginType
(),
GlobalErrorCodeConstants
.
PARAM_REQUIRED
);
String
token
;
String
token
;
switch
(
loginVO
.
getLoginType
())
{
switch
(
loginVO
.
getLoginType
())
{
case
ID_NUMBER_PASSWORD:
case
ID_NUMBER_PASSWORD:
...
@@ -205,13 +207,13 @@ public class LoginServiceImpl implements LoginService {
...
@@ -205,13 +207,13 @@ public class LoginServiceImpl implements LoginService {
//1.根据手机号去库中查询是否存在
//1.根据手机号去库中查询是否存在
ExpertInfoResp
expertInfoResp
=
loginServicesClient
.
querySingleByShengFenZhengOrMobile
(
loginVO
.
getPhoneNumber
(),
null
);
ExpertInfoResp
expertInfoResp
=
loginServicesClient
.
querySingleByShengFenZhengOrMobile
(
loginVO
.
getPhoneNumber
(),
null
);
if
(
expertInfoResp
==
null
){
if
(
expertInfoResp
==
null
){
return
"用户信息不存在"
;
throw
new
BusinessException
(
GlobalErrorCodeConstants
.
USER_NOT_EXISTS
.
getCode
(),
GlobalErrorCodeConstants
.
USER_NOT_EXISTS
.
getMsg
())
;
}
}
//2.存在校验验证码
//2.存在校验验证码
if
(!
smsService
.
verifySmsCode
(
loginVO
.
getPhoneNumber
(),
loginVO
.
getPhoneCode
()))
{
if
(!
smsService
.
verifySmsCode
(
loginVO
.
getPhoneNumber
(),
loginVO
.
getPhoneCode
()))
{
//登录日志
//登录日志
//sysLogLoginService.savePortal(login.getPhone(), Constant.FAIL, LoginOperationEnum.CAPTCHA_FAIL.getValue(), 1);
//sysLogLoginService.savePortal(login.getPhone(), Constant.FAIL, LoginOperationEnum.CAPTCHA_FAIL.getValue(), 1);
throw
new
IllegalArgumentException
(
"手机验证码错误"
);
throw
new
BusinessException
(
GlobalErrorCodeConstants
.
CAPTCHA_EXPIRED
.
getCode
(),
GlobalErrorCodeConstants
.
CAPTCHA_EXPIRED
.
getMsg
()
);
}
}
//3.生成相应的uuid作为redis的key
//3.生成相应的uuid作为redis的key
String
uuidKey
=
UUID
.
randomUUID
().
toString
();
String
uuidKey
=
UUID
.
randomUUID
().
toString
();
...
...
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