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
1d9a15b9
Commit
1d9a15b9
authored
Mar 07, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更正登录统计参数值
parent
898a6fb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
30 deletions
+33
-30
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+27
-30
UserStatistics.java
src/main/java/cn/quantgroup/xyqb/model/UserStatistics.java
+6
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
1d9a15b9
...
@@ -114,6 +114,29 @@ public class UserController implements IBaseController {
...
@@ -114,6 +114,29 @@ public class UserController implements IBaseController {
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
request
,
openId
,
dimension
);
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
request
,
openId
,
dimension
);
}
}
@LogHttpCaller
@PasswordErrorFiniteValidator
@RequestMapping
(
"/login"
)
public
JsonResult
login
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
createdFrom
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
userId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"xyqb"
)
String
key
,
HttpServletRequest
request
,
String
openId
,
@RequestParam
(
required
=
false
)
String
dimension
)
{
LOGGER
.
info
(
"login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},openId:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
openId
,
dimension
);
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
merchant
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"未知的连接"
,
null
);
}
if
(!
StringUtils
.
isEmpty
(
userId
)
&&
userId
.
length
()
>
10
)
{
return
loginWithUserId
(
channelId
,
appChannel
,
createdFrom
,
userId
,
merchant
,
dimension
);
}
else
{
return
loginWithHttpBasic
(
channelId
,
appChannel
,
createdFrom
,
merchant
,
request
,
openId
,
dimension
);
}
}
/**
/**
* 快速登录(手机号 + 短信验证码),H5专用入口
* 快速登录(手机号 + 短信验证码),H5专用入口
* 短信验证码错误达到限定次数时执行图形验证码校验
* 短信验证码错误达到限定次数时执行图形验证码校验
...
@@ -139,29 +162,6 @@ public class UserController implements IBaseController {
...
@@ -139,29 +162,6 @@ public class UserController implements IBaseController {
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
request
);
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
request
);
}
}
@LogHttpCaller
@PasswordErrorFiniteValidator
@RequestMapping
(
"/login"
)
public
JsonResult
login
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
createdFrom
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
userId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"xyqb"
)
String
key
,
HttpServletRequest
request
,
String
openId
,
@RequestParam
(
required
=
false
)
String
dimension
)
{
LOGGER
.
info
(
"login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},openId:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
openId
,
dimension
);
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
merchant
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"未知的连接"
,
null
);
}
if
(!
StringUtils
.
isEmpty
(
userId
)
&&
userId
.
length
()
>
10
)
{
return
loginWithUserId
(
channelId
,
appChannel
,
createdFrom
,
userId
,
merchant
,
dimension
);
}
else
{
return
loginWithHttpBasic
(
channelId
,
appChannel
,
createdFrom
,
merchant
,
request
,
openId
,
dimension
);
}
}
@RequestMapping
(
"/login/fast"
)
@RequestMapping
(
"/login/fast"
)
public
JsonResult
loginFast
(
public
JsonResult
loginFast
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
...
@@ -181,29 +181,26 @@ public class UserController implements IBaseController {
...
@@ -181,29 +181,26 @@ public class UserController implements IBaseController {
JsonResult
successResult
=
validMap
.
get
(
"success"
);
JsonResult
successResult
=
validMap
.
get
(
"success"
);
String
phoneNo
=
successResult
.
getData
().
toString
();
String
phoneNo
=
successResult
.
getData
().
toString
();
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
LOGGER
.
info
(
"用户快速
登录
失败,手机号错误, createdFrom:{},phoneNo:{}"
,
createdFrom
,
phoneNo
);
LOGGER
.
info
(
"用户快速
注册
失败,手机号错误, createdFrom:{},phoneNo:{}"
,
createdFrom
,
phoneNo
);
throw
new
UserNotExistException
(
"手机号错误"
);
throw
new
UserNotExistException
(
"手机号错误"
);
}
}
String
verificationCode
=
successResult
.
getMsg
();
String
verificationCode
=
successResult
.
getMsg
();
// 执行短信验证码检查
// 执行短信验证码检查
verifyPhoneAndCode
(
phoneNo
,
verificationCode
);
verifyPhoneAndCode
(
phoneNo
,
verificationCode
);
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
// 缓存未命中时查DB
if
(
user
==
null
)
{
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
}
if
(
user
!=
null
&&
!
user
.
getEnable
())
{
if
(
user
!=
null
&&
!
user
.
getEnable
())
{
LOGGER
.
error
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
LOGGER
.
error
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
}
}
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
3
,
channelId
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
user
=
userRegisterService
.
register
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
,
dimension
);
user
=
userRegisterService
.
register
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
,
dimension
);
statistics
.
setAction
(
2
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
throw
new
UserNotExistException
(
"用户未找到"
);
throw
new
UserNotExistException
(
"用户未找到"
);
}
}
}
}
//增加登陆统计发送
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
3
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
MqUtils
.
sendLoanVest
(
statistics
);
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
// return createSession(channelId, createdFrom, appChannel, user);
// return createSession(channelId, createdFrom, appChannel, user);
...
@@ -452,7 +449,7 @@ public class UserController implements IBaseController {
...
@@ -452,7 +449,7 @@ public class UserController implements IBaseController {
//用户信息存在,更新session中的最后访问时间,重新写入缓存.
//用户信息存在,更新session中的最后访问时间,重新写入缓存.
if
(
null
!=
user
||
!
user
.
getEnable
())
{
if
(
null
!=
user
||
!
user
.
getEnable
())
{
//增加登陆统计发送
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
1
,
channelId
);
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
4
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
MqUtils
.
sendLoanVest
(
statistics
);
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
}
else
{
}
else
{
...
...
src/main/java/cn/quantgroup/xyqb/model/UserStatistics.java
View file @
1d9a15b9
...
@@ -12,6 +12,12 @@ public class UserStatistics {
...
@@ -12,6 +12,12 @@ public class UserStatistics {
private
String
uuid
;
private
String
uuid
;
private
Long
registerFrom
;
private
Long
registerFrom
;
private
String
dimension
;
private
String
dimension
;
/**
* 1-登录
* 2-注册
* 3-快捷登录
* 4-免密登录
*/
private
int
action
;
//登录0,注册1,快捷登录2,免密登录3
private
int
action
;
//登录0,注册1,快捷登录2,免密登录3
private
Long
channel
;
private
Long
channel
;
...
...
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