记得上下班打卡 | 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
a66ea675
Commit
a66ea675
authored
Nov 18, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_20111115' into dev_20111115
parents
f5be66e1
3ad27785
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
56 deletions
+101
-56
AdamLoginController.java
...iquidnet/service/adam/controller/AdamLoginController.java
+101
-56
No files found.
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamLoginController.java
View file @
a66ea675
...
@@ -225,62 +225,62 @@ public class AdamLoginController {
...
@@ -225,62 +225,62 @@ public class AdamLoginController {
return
this
.
loginVoResponseProcessing
(
loginInfoVo
);
return
this
.
loginVoResponseProcessing
(
loginInfoVo
);
}
}
@ApiOperationSupport
(
order
=
5
)
//
@ApiOperationSupport(order = 5)
@ApiOperation
(
value
=
"微信小程序登录"
)
//
@ApiOperation(value = "微信小程序登录")
@ApiImplicitParams
({
//
@ApiImplicitParams({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"anum"
,
value
=
"应用标识[1-正在|2-草莓音乐节|3-五百里|4-MDSK]"
,
allowableValues
=
"1,2,3,4"
),
//
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "anum", value = "应用标识[1-正在|2-草莓音乐节|3-五百里|4-MDSK]", allowableValues = "1,2,3,4"),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"临时票据"
),
//
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "临时票据"),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"encryptedData"
,
value
=
"访问令牌"
),
//
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "encryptedData", value = "访问令牌"),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"iv"
,
value
=
"访问令牌"
),
//
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "iv", value = "访问令牌"),
})
//
})
@PostMapping
(
value
=
{
"login/wca"
})
//
@PostMapping(value = {"login/wca"})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByWechatApplet
(
@RequestParam
Integer
anum
,
//
public ResponseDto<AdamLoginInfoVo> loginByWechatApplet(@RequestParam Integer anum,
@RequestParam
String
code
,
//
@RequestParam String code,
@RequestParam
String
encryptedData
,
//
@RequestParam String encryptedData,
@RequestParam
String
iv
)
{
//
@RequestParam String iv) {
log
.
info
(
"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
;
//
String wechatMobile, wechatOpenid, wechatUnionid;
try
{
//
try {
WxMaJscode2SessionResult
wxMaJscode2SessionResult
=
adamWechatService
.
sessionInfo
(
code
,
anum
);
//
WxMaJscode2SessionResult wxMaJscode2SessionResult = adamWechatService.sessionInfo(code, anum);
//
WxMaPhoneNumberInfo
wxMaPhoneNumberInfo
=
adamWechatService
.
phoneNumberInfo
(
wxMaJscode2SessionResult
.
getSessionKey
(),
encryptedData
,
iv
,
anum
);
//
WxMaPhoneNumberInfo wxMaPhoneNumberInfo = adamWechatService.phoneNumberInfo(wxMaJscode2SessionResult.getSessionKey(), encryptedData, iv, anum);
//
wechatMobile
=
wxMaPhoneNumberInfo
.
getPurePhoneNumber
();
//
wechatMobile = wxMaPhoneNumberInfo.getPurePhoneNumber();
wechatOpenid
=
wxMaJscode2SessionResult
.
getOpenid
();
//
wechatOpenid = wxMaJscode2SessionResult.getOpenid();
wechatUnionid
=
wxMaJscode2SessionResult
.
getUnionid
();
//
wechatUnionid = wxMaJscode2SessionResult.getUnionid();
}
catch
(
WxErrorException
e
)
{
//
} catch (WxErrorException e) {
log
.
error
(
"login by wechat applet exception:[anum:{},code:{},encryptedData:{},iv:{}], errmsg:{}"
,
anum
,
code
,
encryptedData
,
iv
,
e
.
getMessage
());
//
log.error("login by wechat applet exception:[anum:{},code:{},encryptedData:{},iv:{}], errmsg:{}", anum, code, encryptedData, iv, e.getMessage());
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10001"
));
//
return ResponseDto.failure(ErrorMapping.get("10001"));
}
//
}
//
if
(
StringUtils
.
isEmpty
(
wechatMobile
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10005"
));
//
if (StringUtils.isEmpty(wechatMobile)) return ResponseDto.failure(ErrorMapping.get("10005"));
//
String
uid
=
adamRdmService
.
getUidByMobile
(
wechatMobile
);
//
String uid = adamRdmService.getUidByMobile(wechatMobile);
boolean
toRegister
=
StringUtils
.
isEmpty
(
uid
);
//
boolean toRegister = StringUtils.isEmpty(uid);
//
AdamUserInfoVo
userInfoVo
=
toRegister
?
adamUserService
.
register
(
wechatMobile
)
:
adamRdmService
.
getUserInfoVoByUid
(
uid
);
//
AdamUserInfoVo userInfoVo = toRegister ? adamUserService.register(wechatMobile) : adamRdmService.getUserInfoVoByUid(uid);
//
if
(!
toRegister
&&
(
null
==
userInfoVo
||
userInfoVo
.
getState
()
==
2
))
{
//
if (!toRegister && (null == userInfoVo || userInfoVo.getState() == 2)) {
log
.
warn
(
"Cancelled mobile:{}"
,
wechatMobile
);
//
log.warn("Cancelled mobile:{}", wechatMobile);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10024"
));
//
return ResponseDto.failure(ErrorMapping.get("10024"));
}
//
}
//
// 根据skip值,设置IsComplete(考虑到已存在用户未完善信息的情况,这里只对返回数据单独设置IsComplete)
//
// 根据skip值,设置IsComplete(考虑到已存在用户未完善信息的情况,这里只对返回数据单独设置IsComplete)
userInfoVo
.
setIsComplete
(
1
);
//
userInfoVo.setIsComplete(1);
//
AdamLoginInfoVo
loginInfoVo
=
AdamLoginInfoVo
.
getNew
();
//
AdamLoginInfoVo loginInfoVo = AdamLoginInfoVo.getNew();
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
userInfoVo
));
//
loginInfoVo.setToken(this.ssoProcess(userInfoVo));
loginInfoVo
.
setUserInfo
(
userInfoVo
);
//
loginInfoVo.setUserInfo(userInfoVo);
if
(!
toRegister
)
{
//
if (!toRegister) {
loginInfoVo
.
setUserMemberVo
(
adamRdmService
.
getUserMemberVoByUid
(
userInfoVo
.
getUid
()));
//
loginInfoVo.setUserMemberVo(adamRdmService.getUserMemberVoByUid(userInfoVo.getUid()));
}
//
}
loginInfoVo
.
setWechatOpenid
(
wechatOpenid
);
//
loginInfoVo.setWechatOpenid(wechatOpenid);
loginInfoVo
.
setWechatUnionid
(
wechatUnionid
);
//
loginInfoVo.setWechatUnionid(wechatUnionid);
//
log
.
info
(
UserPathDto
.
setData
(
toRegister
?
"注册"
:
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
//
log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo));
// return ResponseDto.success(loginInfoVo.desensitize(reviewUserInfo).finalRating());
//
//
return ResponseDto.success(loginInfoVo.desensitize(reviewUserInfo).finalRating());
return
this
.
loginVoResponseProcessing
(
loginInfoVo
);
//
return this.loginVoResponseProcessing(loginInfoVo);
}
//
}
@ApiOperationSupport
(
order
=
6
)
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"第三方账号登录"
)
@ApiOperation
(
value
=
"第三方账号登录"
)
...
@@ -323,6 +323,51 @@ public class AdamLoginController {
...
@@ -323,6 +323,51 @@ public class AdamLoginController {
return
this
.
loginVoResponseProcessing
(
loginInfoVo
);
return
this
.
loginVoResponseProcessing
(
loginInfoVo
);
}
}
@ApiOperationSupport
(
order
=
7
)
@ApiOperation
(
value
=
"手机号静默登录"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mobile"
,
value
=
"手机号"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"otp"
,
value
=
"临时票据"
),
})
@PostMapping
(
value
=
{
"login/silent/mobile"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByMobile
(
@Pattern
(
regexp
=
"\\d{11}"
,
message
=
"手机号格式有误"
)
@NotBlank
(
message
=
"手机号不能为空"
)
@RequestParam
String
mobile
,
@NotBlank
(
message
=
"临时票据不能为空"
)
@RequestParam
String
otp
)
{
log
.
info
(
"login by silent for mobile:{},{}"
,
mobile
,
otp
);
String
otpDecrypt
=
null
;
try
{
otpDecrypt
=
DESUtils
.
DES
().
decrypt
(
otp
);
}
catch
(
Exception
e
)
{
}
if
(
null
==
otpDecrypt
||
!
otpDecrypt
.
substring
(
5
).
equals
(
mobile
.
substring
(
5
)))
{
log
.
error
(
"login by silent for mobile:{},{}/{}"
,
mobile
,
otp
,
otpDecrypt
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10005"
));
}
String
uid
=
adamRdmService
.
getUidByMobile
(
mobile
);
boolean
toRegister
=
StringUtils
.
isEmpty
(
uid
);
AdamUserInfoVo
userInfoVo
=
toRegister
?
adamUserService
.
register
(
mobile
)
:
adamRdmService
.
getUserInfoVoByUid
(
uid
);
if
(!
toRegister
&&
(
null
==
userInfoVo
||
userInfoVo
.
getState
()
==
2
))
{
log
.
warn
(
"Cancelled mobile:{}"
,
mobile
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10024"
));
}
AdamLoginInfoVo
loginInfoVo
=
AdamLoginInfoVo
.
getNew
();
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
userInfoVo
));
loginInfoVo
.
setUserInfo
(
userInfoVo
);
if
(!
toRegister
)
{
loginInfoVo
.
setUserMemberVo
(
adamRdmService
.
getUserMemberVoByUid
(
userInfoVo
.
getUid
()));
}
log
.
info
(
UserPathDto
.
setData
(
toRegister
?
"注册"
:
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
return
this
.
loginVoResponseProcessing
(
loginInfoVo
);
}
@ApiOperationSupport
(
order
=
7
)
@ApiOperationSupport
(
order
=
7
)
@ApiOperation
(
value
=
"登出"
)
@ApiOperation
(
value
=
"登出"
)
@PostMapping
(
value
=
{
"out"
})
@PostMapping
(
value
=
{
"out"
})
...
...
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