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
4d714c28
Commit
4d714c28
authored
Aug 25, 2022
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
冻结后提示修改
parent
837c432c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
11 deletions
+21
-11
UserConstant.java
src/main/java/cn/quantgroup/xyqb/constant/UserConstant.java
+2
-0
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+3
-2
AppController.java
...antgroup/xyqb/controller/internal/user/AppController.java
+4
-3
InnerController.java
...tgroup/xyqb/controller/internal/user/InnerController.java
+6
-4
LoginModule.java
...group/xyqb/controller/middleoffice/login/LoginModule.java
+3
-1
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+3
-1
No files found.
src/main/java/cn/quantgroup/xyqb/constant/UserConstant.java
View file @
4d714c28
...
...
@@ -2,4 +2,6 @@ package cn.quantgroup.xyqb.constant;
public
class
UserConstant
{
public
static
final
String
USER_ERROR_OR_PASSWORD_ERROR
=
"帐号或密码错误"
;
public
static
final
String
USER_ERROR_OR_ENABLE_ERROR
=
"账号异常,请联系平台客服。"
;
}
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
4d714c28
...
...
@@ -48,6 +48,7 @@ import java.nio.charset.Charset;
import
java.util.*
;
import
static
cn
.
quantgroup
.
xyqb
.
Constants
.
VERIFICATION_CODE_FINITE_COUNT_NEW
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_ENABLE_ERROR
;
/**
* Http服务接口:用户注册、登录、重置密码
...
...
@@ -787,7 +788,7 @@ public class UserController implements IBaseController {
User
user
=
userService
.
findByUuidInDb
(
userId
);
if
(
Objects
.
isNull
(
user
)
||
!
user
.
getEnable
())
{
log
.
error
(
"用户不存在,或者已经注销,userId:{}"
,
userId
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
else
if
(!
wechatRelateUserIfNecessary
(
user
,
request
))
{
return
JsonResult
.
buildErrorStateResult
(
"登录时微信关联失败"
,
null
);
}
...
...
@@ -888,7 +889,7 @@ public class UserController implements IBaseController {
User
user
=
userService
.
findById
(
userId
);
if
(
Objects
.
isNull
(
user
)
||
!
user
.
getEnable
())
{
log
.
error
(
"用户不存在,或者已经注销,userId:{}"
,
userId
);
return
JsonResult
.
buildErrorStateResult
(
"登出失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/AppController.java
View file @
4d714c28
...
...
@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.persistence.PersistenceException
;
import
javax.servlet.http.HttpServletRequest
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_ENABLE_ERROR
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_PASSWORD_ERROR
;
/**
...
...
@@ -97,7 +98,7 @@ public class AppController implements IBaseController {
if
(
user
==
null
)
{
result
=
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_PASSWORD_ERROR
,
null
);
}
else
if
(!
user
.
getEnable
())
{
result
=
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
result
=
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
else
{
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
merchant
==
null
)
{
...
...
@@ -231,7 +232,7 @@ public class AppController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_PASSWORD_ERROR
,
null
);
}
if
(!
user
.
getEnable
())
{
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
merchant
==
null
)
{
...
...
@@ -335,7 +336,7 @@ public class AppController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_PASSWORD_ERROR
,
null
);
}
if
(!
user
.
getEnable
())
{
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
//校验租户ID tenantId
oauthLoginInfoService
.
addLoginInfo
(
user
,
tenantId
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/InnerController.java
View file @
4d714c28
...
...
@@ -57,6 +57,8 @@ import java.text.ParseException;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_ENABLE_ERROR
;
/**
* Created by Miraculous on 2016/12/19.
...
...
@@ -249,7 +251,7 @@ public class InnerController implements IBaseController {
User
user
=
userService
.
findByUuidWithCache
(
uuid
);
if
(
null
!=
user
)
{
if
(!
user
.
getEnable
())
{
return
JsonResult
.
buildSuccessResult
(
""
,
null
);
return
JsonResult
.
buildSuccessResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
user
.
getId
());
UserInfo
info
=
new
UserInfo
(
user
,
userDetail
);
...
...
@@ -273,7 +275,7 @@ public class InnerController implements IBaseController {
User
user
=
userService
.
findByPhoneInDb
(
phone
);
if
(
null
!=
user
)
{
if
(!
user
.
getEnable
())
{
return
JsonResult
.
buildSuccessResult
(
""
,
null
);
return
JsonResult
.
buildSuccessResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
user
.
getId
());
UserInfo
info
=
new
UserInfo
(
user
,
userDetail
);
...
...
@@ -329,7 +331,7 @@ public class InnerController implements IBaseController {
//存在已注销
if
(!
user
.
getEnable
())
{
log
.
info
(
"用户已经注销,phoneNo:{}"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"用户已经注销"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
// 插入关联数据
...
...
@@ -1316,7 +1318,7 @@ public class InnerController implements IBaseController {
// 检查用户有效性
if
(
user
!=
null
&&
!
user
.
getEnable
())
{
log
.
error
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
// 用户不存在时自动注册
if
(
Objects
.
isNull
(
user
))
{
...
...
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/login/LoginModule.java
View file @
4d714c28
...
...
@@ -15,6 +15,8 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_ENABLE_ERROR
;
/**
* 面向服务的聚合模块。
*/
...
...
@@ -50,7 +52,7 @@ public class LoginModule implements ILoginModule {
//用户不存在
log
.
info
(
"用户尝试登录,已注销:{}"
,
phoneNo
);
//todo 自定义异常
throw
new
DataException
(
"用户名或密码不正确"
);
throw
new
DataException
(
USER_ERROR_OR_ENABLE_ERROR
);
}
//验证
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
4d714c28
...
...
@@ -45,6 +45,8 @@ import java.util.*;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_ENABLE_ERROR
;
/**
* Created by Miraculous on 15/7/5.
*/
...
...
@@ -374,7 +376,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
User
user
=
findByPhoneWithCache
(
phoneNo
);
if
(
user
!=
null
&&
!
user
.
getEnable
())
{
log
.
info
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
USER_ERROR_OR_ENABLE_ERROR
,
null
);
}
if
(
user
==
null
)
{
// Service层会负责发送注册消息到LoanVest
...
...
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