记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
97a3a640
Commit
97a3a640
authored
Aug 09, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+密码登录:只针对PHP老用户;
parent
dc5f8607
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
155 additions
and
48 deletions
+155
-48
AdamUserInfoParam.java
...ava/com/liquidnet/service/adam/dto/AdamUserInfoParam.java
+2
-2
AdamLoginInfoVo.java
...va/com/liquidnet/service/adam/dto/vo/AdamLoginInfoVo.java
+68
-2
AdamUserInfoVo.java
...ava/com/liquidnet/service/adam/dto/vo/AdamUserInfoVo.java
+19
-16
application-dev.yml
liquidnet-bus-config/liquidnet-config/application-dev.yml
+2
-0
application-test.yml
liquidnet-bus-config/liquidnet-config/application-test.yml
+2
-0
AdamLoginController.java
...iquidnet/service/adam/controller/AdamLoginController.java
+57
-23
errors.properties
...et-service-adam-impl/src/main/resources/errors.properties
+5
-5
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/AdamUserInfoParam.java
View file @
97a3a640
...
...
@@ -36,8 +36,8 @@ public class AdamUserInfoParam implements java.io.Serializable {
@ApiModelProperty
(
position
=
16
,
required
=
true
,
value
=
"常住地/区域[100]"
,
example
=
"北京 北京市 朝阳区"
)
// @NotBlank(message = "常住地不能为空")
private
String
area
;
@ApiModelProperty
(
position
=
17
,
required
=
true
,
value
=
"签名[
15
]"
,
example
=
"..................."
)
// @Size(max =
15
, message = "已超出签名长度限制")
@ApiModelProperty
(
position
=
17
,
required
=
true
,
value
=
"签名[
30
]"
,
example
=
"..................."
)
// @Size(max =
30
, message = "已超出签名长度限制")
private
String
signature
;
@ApiModelProperty
(
position
=
18
,
required
=
true
,
value
=
"标签[500]"
,
example
=
"[{\"val\":\"MMS01\",\"desc\":\"民歌\",\"tagVos\":[{\"val\":\"MMS0101\",\"desc\":\"A\"},{\"val\":\"MMS0102\",\"desc\":\"B\"}]},{\"val\":\"MMS02\",\"desc\":\"house\",\"tagVos\":[{\"val\":\"MMS0201\",\"desc\":\"C\"}]}]"
)
// @NotNull
...
...
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamLoginInfoVo.java
View file @
97a3a640
package
com
.
liquidnet
.
service
.
adam
.
dto
.
vo
;
import
com.liquidnet.commons.lang.util.SensitizeUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@ApiModel
(
value
=
"AdamLoginInfoVo"
,
description
=
"登录成功响应数据"
)
@Data
public
class
AdamLoginInfoVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
4209754800686327524L
;
@ApiModelProperty
(
position
=
11
,
value
=
"TOKEN"
)
...
...
@@ -29,6 +28,73 @@ public class AdamLoginInfoVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
18
,
value
=
"微信用户unionid(微信小程序登录返回,用于给小程序用户推送信息)"
)
private
String
wechatUnionid
;
public
String
getToken
()
{
return
token
;
}
public
void
setToken
(
String
token
)
{
this
.
token
=
token
;
}
public
AdamUserInfoVo
getUserInfo
()
{
return
userInfo
;
}
public
void
setUserInfo
(
AdamUserInfoVo
userInfo
)
{
this
.
userInfo
=
userInfo
;
this
.
userInfo
.
setPasswd
(
null
);
// this.userInfo.setPayCode(null);
this
.
userInfo
.
setMobile
(
SensitizeUtil
.
custom
(
userInfo
.
getMobile
(),
3
,
4
));
}
public
AdamRealInfoVo
getRealNameInfo
()
{
return
realNameInfo
;
}
public
void
setRealNameInfo
(
AdamRealInfoVo
realNameInfo
)
{
this
.
realNameInfo
=
realNameInfo
;
}
public
List
<
AdamThirdPartInfoVo
>
getThirdPartInfo
()
{
return
thirdPartInfo
;
}
public
void
setThirdPartInfo
(
List
<
AdamThirdPartInfoVo
>
thirdPartInfo
)
{
this
.
thirdPartInfo
=
thirdPartInfo
;
}
public
AdamMemberSimpleVo
getMemberVo
()
{
return
memberVo
;
}
public
void
setMemberVo
(
AdamMemberSimpleVo
memberVo
)
{
this
.
memberVo
=
memberVo
;
}
public
AdamUserMemberVo
getUserMemberVo
()
{
return
userMemberVo
;
}
public
void
setUserMemberVo
(
AdamUserMemberVo
userMemberVo
)
{
this
.
userMemberVo
=
userMemberVo
;
}
public
String
getWechatOpenid
()
{
return
wechatOpenid
;
}
public
void
setWechatOpenid
(
String
wechatOpenid
)
{
this
.
wechatOpenid
=
wechatOpenid
;
}
public
String
getWechatUnionid
()
{
return
wechatUnionid
;
}
public
void
setWechatUnionid
(
String
wechatUnionid
)
{
this
.
wechatUnionid
=
wechatUnionid
;
}
private
static
final
AdamLoginInfoVo
obj
=
new
AdamLoginInfoVo
();
public
static
AdamLoginInfoVo
getNew
()
{
...
...
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamUserInfoVo.java
View file @
97a3a640
...
...
@@ -2,7 +2,6 @@ package com.liquidnet.service.adam.dto.vo;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.SensitizeUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -18,38 +17,42 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable {
private
String
uid
;
@ApiModelProperty
(
position
=
11
,
value
=
"手机号[20]"
)
private
String
mobile
;
@ApiModelProperty
(
position
=
12
,
value
=
"昵称[32]"
)
@ApiModelProperty
(
position
=
12
,
value
=
"登录密码[64],只针对PHP老用户,新用户无此功能"
)
private
String
passwd
;
// @ApiModelProperty(position = 13, value = "支付密码[30],暂无此功能")
// private String payCode;
@ApiModelProperty
(
position
=
14
,
value
=
"昵称[32]"
)
private
String
nickname
;
@ApiModelProperty
(
position
=
1
3
,
value
=
"状态[1-正常,2-注销]"
)
@ApiModelProperty
(
position
=
1
5
,
value
=
"状态[1-正常,2-注销]"
)
private
Integer
state
;
@ApiModelProperty
(
position
=
1
4
,
value
=
"性别[32]"
)
@ApiModelProperty
(
position
=
1
6
,
value
=
"性别[32]"
)
private
AdamTagVo
sex
;
@ApiModelProperty
(
position
=
1
5
,
value
=
"生日[YYYY-MM-DD]"
)
@ApiModelProperty
(
position
=
1
7
,
value
=
"生日[YYYY-MM-DD]"
)
private
String
birthday
;
@ApiModelProperty
(
position
=
1
6
,
value
=
"常住地/区域"
)
@ApiModelProperty
(
position
=
1
8
,
value
=
"常住地/区域"
)
private
String
area
;
@ApiModelProperty
(
position
=
1
7
,
value
=
"个性签名"
)
@ApiModelProperty
(
position
=
1
9
,
value
=
"个性签名"
)
private
String
signature
;
@ApiModelProperty
(
position
=
18
,
value
=
"头像"
)
@ApiModelProperty
(
position
=
20
,
value
=
"头像"
)
private
String
avatar
;
@ApiModelProperty
(
position
=
19
,
value
=
"背景图"
)
@ApiModelProperty
(
position
=
21
,
value
=
"背景图"
)
private
String
background
;
@ApiModelProperty
(
position
=
2
0
,
value
=
"标签"
)
@ApiModelProperty
(
position
=
2
2
,
value
=
"标签"
)
private
List
<
AdamTagParentVo
>
tagMe
;
@ApiModelProperty
(
position
=
2
1
,
value
=
"注册时间"
)
@ApiModelProperty
(
position
=
2
3
,
value
=
"注册时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createAt
;
@ApiModelProperty
(
position
=
2
2
,
value
=
"最近一次更新时间"
)
@ApiModelProperty
(
position
=
2
4
,
value
=
"最近一次更新时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updatedAt
;
@ApiModelProperty
(
position
=
2
3
,
value
=
"注销时间"
)
@ApiModelProperty
(
position
=
2
5
,
value
=
"注销时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
closedAt
;
@ApiModelProperty
(
position
=
2
4
,
value
=
"完善信息进度[0-未完善,1-已完善]"
)
@ApiModelProperty
(
position
=
2
6
,
value
=
"完善信息进度[0-未完善,1-已完善]"
)
private
Integer
isComplete
;
@ApiModelProperty
(
position
=
2
5
,
value
=
""
)
@ApiModelProperty
(
position
=
2
7
,
value
=
""
)
private
String
rongCloudToken
;
@ApiModelProperty
(
position
=
2
6
,
value
=
"身份二维码"
)
@ApiModelProperty
(
position
=
2
8
,
value
=
"身份二维码"
)
private
String
qrCode
;
private
static
final
AdamUserInfoVo
obj
=
new
AdamUserInfoVo
();
...
...
liquidnet-bus-config/liquidnet-config/application-dev.yml
View file @
97a3a640
...
...
@@ -2,6 +2,8 @@ config-server-git: dev111
#application-dev-begin
#这里后续添加公共参数值
liquidnet
:
secret
:
passwd-salt
:
NTZiYzg4
security
:
username
:
user
password
:
user123
...
...
liquidnet-bus-config/liquidnet-config/application-test.yml
View file @
97a3a640
...
...
@@ -2,6 +2,8 @@ config-server-git: test
#application-test-begin
#这里后续添加公共参数值
liquidnet
:
secret
:
passwd-salt
:
NTZiYzg4
security
:
username
:
user
password
:
user123
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamLoginController.java
View file @
97a3a640
...
...
@@ -78,7 +78,10 @@ public class AdamLoginController {
@Value
(
"${liquidnet.reviewer.app-login.mobile}"
)
private
String
reviewMobile
;
@ApiOperationSupport
(
order
=
2
)
@Value
(
"${liquidnet.secret.passwd-salt}"
)
private
String
passwdSalt
;
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"发送验证码"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mobile"
,
value
=
"手机号"
),
...
...
@@ -90,7 +93,7 @@ public class AdamLoginController {
String
smsCodeByMobile
=
adamRdmService
.
getSmsCodeByMobile
(
mobile
);
if
(
StringUtils
.
isNotEmpty
(
smsCodeByMobile
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10003
"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10000
"
));
}
String
smsCode
=
RandomStringUtils
.
randomNumeric
(
6
);
...
...
@@ -105,6 +108,37 @@ public class AdamLoginController {
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10002"
));
}
@ApiOperationSupport
(
order
=
2
)
@ApiOperation
(
value
=
"手机号密码登录"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mobile"
,
value
=
"手机号"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"password"
,
value
=
"登录密码(只针对PHP老用户,新用户无此功能)"
),
})
@PostMapping
(
value
=
{
"login/pin"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByPin
(
@Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
@RequestParam
String
mobile
,
@RequestParam
String
password
)
{
log
.
info
(
"mobile:{},passwd:{}"
,
mobile
,
password
);
String
uid
=
adamRdmService
.
getUidByMobile
(
mobile
);
if
(
StringUtils
.
isEmpty
(
uid
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10003"
));
}
AdamUserInfoVo
userInfoVo
=
adamRdmService
.
getUserInfoVoByUid
(
uid
);
String
passwdMd5
=
DigestUtils
.
md5DigestAsHex
(
password
.
toLowerCase
().
concat
(
passwdSalt
).
getBytes
(
StandardCharsets
.
UTF_8
));
if
(!
passwdMd5
.
equals
(
userInfoVo
.
getPasswd
()))
{
// 密码校验
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10013"
));
}
AdamLoginInfoVo
loginInfoVo
=
AdamLoginInfoVo
.
getNew
();
loginInfoVo
.
setUserMemberVo
(
adamRdmService
.
getUserMemberVoByUid
(
userInfoVo
.
getUid
()));
loginInfoVo
.
setUserInfo
(
userInfoVo
);
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
userInfoVo
));
log
.
info
(
UserPathDto
.
setData
(
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
return
ResponseDto
.
success
(
loginInfoVo
);
}
@ApiOperationSupport
(
order
=
3
)
@ApiOperation
(
value
=
"手机验证码登录"
)
@ApiImplicitParams
({
...
...
@@ -117,7 +151,7 @@ public class AdamLoginController {
@RequestParam
String
mobile
,
@Pattern
(
regexp
=
"\\d{6}"
,
message
=
"验证码格式有误"
)
@RequestParam
String
code
,
@RequestParam
(
required
=
false
)
Integer
skip
)
{
log
.
debug
(
"mobile:{},code:{}"
,
mobile
,
code
);
log
.
info
(
"mobile:{},code:{}"
,
mobile
,
code
);
ResponseDto
<
AdamLoginInfoVo
>
checkSmsCodeDto
=
this
.
checkSmsCode
(
mobile
,
code
);
if
(!
checkSmsCodeDto
.
isSuccess
())
return
checkSmsCodeDto
;
...
...
@@ -148,7 +182,7 @@ public class AdamLoginController {
// loginInfoVo.setMemberVo(adamRdmService.getMemberSimpleVo());
loginInfoVo
.
setUserInfo
(
userInfoVo
);
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
userInfoVo
));
loginInfoVo
.
getUserInfo
().
setMobile
(
SensitizeUtil
.
custom
(
userInfoVo
.
getMobile
(),
3
,
4
));
//
loginInfoVo.getUserInfo().setMobile(SensitizeUtil.custom(userInfoVo.getMobile(), 3, 4));
log
.
info
(
UserPathDto
.
setData
(
toRegister
?
"注册"
:
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
return
ResponseDto
.
success
(
loginInfoVo
);
}
...
...
@@ -160,7 +194,7 @@ public class AdamLoginController {
})
@PostMapping
(
value
=
{
"login/mobile"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByMobile
(
@NotBlank
(
message
=
"访问令牌不能为空"
)
@RequestParam
String
accessToken
)
{
log
.
debug
(
"login by mobile access token:{}"
,
accessToken
);
log
.
info
(
"login by mobile access token:{}"
,
accessToken
);
String
mobile
=
this
.
getMobile
(
accessToken
);
if
(
StringUtils
.
isEmpty
(
mobile
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10005"
));
...
...
@@ -186,7 +220,7 @@ public class AdamLoginController {
// loginInfoVo.setMemberVo(adamRdmService.getMemberSimpleVo());
loginInfoVo
.
setUserInfo
(
userInfoVo
);
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
userInfoVo
));
loginInfoVo
.
getUserInfo
().
setMobile
(
SensitizeUtil
.
custom
(
userInfoVo
.
getMobile
(),
3
,
4
));
//
loginInfoVo.getUserInfo().setMobile(SensitizeUtil.custom(userInfoVo.getMobile(), 3, 4));
log
.
info
(
UserPathDto
.
setData
(
toRegister
?
"注册"
:
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
return
ResponseDto
.
success
(
loginInfoVo
);
}
...
...
@@ -204,7 +238,7 @@ public class AdamLoginController {
@RequestParam
String
code
,
@RequestParam
String
encryptedData
,
@RequestParam
String
iv
)
{
log
.
debug
(
"login by wechat applet:[anum:{},code:{},encryptedData:{},iv:{}]"
,
anum
,
code
,
encryptedData
,
iv
);
log
.
info
(
"login by wechat applet:[anum:{},code:{},encryptedData:{},iv:{}]"
,
anum
,
code
,
encryptedData
,
iv
);
String
wechatMobile
,
wechatOpenid
,
wechatUnionid
;
try
{
WxMaJscode2SessionResult
wxMaJscode2SessionResult
=
adamWechatService
.
sessionInfo
(
code
,
anum
);
...
...
@@ -216,7 +250,7 @@ public class AdamLoginController {
wechatUnionid
=
wxMaJscode2SessionResult
.
getUnionid
();
}
catch
(
WxErrorException
e
)
{
log
.
error
(
"login by wechat applet exception:[anum:{},code:{},encryptedData:{},iv:{}], errmsg:{}"
,
anum
,
code
,
encryptedData
,
iv
,
e
.
getMessage
());
return
ResponseDto
.
failure
(
"微信小程序解码信息失败"
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10001"
)
);
}
if
(
StringUtils
.
isEmpty
(
wechatMobile
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10005"
));
...
...
@@ -246,7 +280,7 @@ public class AdamLoginController {
// loginInfoVo.setMemberVo(adamRdmService.getMemberSimpleVo());
loginInfoVo
.
setUserInfo
(
userInfoVo
);
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
userInfoVo
));
loginInfoVo
.
getUserInfo
().
setMobile
(
SensitizeUtil
.
custom
(
userInfoVo
.
getMobile
(),
3
,
4
));
//
loginInfoVo.getUserInfo().setMobile(SensitizeUtil.custom(userInfoVo.getMobile(), 3, 4));
loginInfoVo
.
setWechatOpenid
(
wechatOpenid
);
loginInfoVo
.
setWechatUnionid
(
wechatUnionid
);
log
.
info
(
UserPathDto
.
setData
(
toRegister
?
"注册"
:
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
...
...
@@ -257,7 +291,7 @@ public class AdamLoginController {
@ApiOperation
(
value
=
"第三方账号登录"
)
@PostMapping
(
value
=
{
"login/tpa"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByThirdPartApp
(
@Valid
@RequestBody
AdamThirdPartParam
parameter
)
{
log
.
debug
(
"login by tpa:{}"
,
JsonUtils
.
toJson
(
parameter
));
log
.
info
(
"login by tpa:{}"
,
JsonUtils
.
toJson
(
parameter
));
boolean
toRegister
=
false
;
AdamLoginInfoVo
loginInfoVo
=
AdamLoginInfoVo
.
getNew
();
if
(
StringUtils
.
isEmpty
(
parameter
.
getMobile
()))
{
...
...
@@ -286,7 +320,7 @@ public class AdamLoginController {
toRegister
=
true
;
}
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
loginInfoVo
.
getUserInfo
()));
loginInfoVo
.
getUserInfo
().
setMobile
(
SensitizeUtil
.
custom
(
loginInfoVo
.
getUserInfo
().
getMobile
(),
3
,
4
));
//
loginInfoVo.getUserInfo().setMobile(SensitizeUtil.custom(loginInfoVo.getUserInfo().getMobile(), 3, 4));
log
.
info
(
UserPathDto
.
setData
(
toRegister
?
"注册"
:
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
return
ResponseDto
.
success
(
loginInfoVo
);
}
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/resources/errors.properties
View file @
97a3a640
...
...
@@ -3,11 +3,11 @@
40003
=
登录已过期
# ------------------------ 4开头错误码作系统保留
10000
=
请求频繁,
稍后再试
10001
=
10000
=
操作过于频繁,请
稍后再试
10001
=
授权失败
10002
=
验证码发送失败
10003
=
发送过于频繁,请稍后再试
10004
=
验证码错误,请重新输入
10003
=
请输入正确手机号
10004
=
请输入正确验证码
10005
=
手机号获取失败,请更换登录方式
10006
=
第三方账号未注册
10007
=
该第三方账号已经被其他用户绑定
...
...
@@ -16,7 +16,7 @@
10010
=
该手机号已被其它账号绑定
10011
=
性别标签无效
10012
=
音乐风格标签无效
10013
=
10013
=
账号与密码不匹配
10014
=
10015
=
入场人ID不能为空
10016
=
收货地址ID不能为空
...
...
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