记得上下班打卡 | 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
175718e6
Commit
175718e6
authored
Aug 03, 2021
by
张国柄
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+API:第三方账号登录v1;
parent
303e487b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
4 deletions
+42
-4
AdamLoginController.java
...iquidnet/service/adam/controller/AdamLoginController.java
+42
-4
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 @
175718e6
...
@@ -299,6 +299,44 @@ public class AdamLoginController {
...
@@ -299,6 +299,44 @@ public class AdamLoginController {
}
}
@ApiOperationSupport
(
order
=
6
)
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"第三方账号登录v1"
)
@PostMapping
(
value
=
{
"login/tpa_v1"
})
public
ResponseDto
<
AdamLoginInfoVo
>
loginByTpaV1
(
@Valid
@RequestBody
AdamThirdPartParam
parameter
)
{
log
.
debug
(
"login by tpa:{}"
,
JsonUtils
.
toJson
(
parameter
));
boolean
toRegister
=
false
;
AdamLoginInfoVo
loginInfoVo
=
AdamLoginInfoVo
.
getNew
();
if
(
StringUtils
.
isEmpty
(
parameter
.
getMobile
()))
{
String
uid
=
adamRdmService
.
getUidByPlatformOpenId
(
parameter
.
getPlatform
(),
parameter
.
getOpenId
());
if
(
StringUtils
.
isEmpty
(
uid
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10006"
));
loginInfoVo
.
setUserInfo
(
adamRdmService
.
getUserInfoVoByUid
(
uid
));
// loginInfoVo.setRealNameInfo(adamRdmService.getRealInfoVoByUid(uid));
// loginInfoVo.setThirdPartInfo(adamRdmService.getThirdPartVoListByUid(uid));
loginInfoVo
.
setUserMemberVo
(
adamRdmService
.
getUserMemberVoByUid
(
uid
));
// loginInfoVo.setMemberVo(adamRdmService.getMemberSimpleVo());
}
else
{
// 新账号注册
ResponseDto
<
AdamLoginInfoVo
>
checkSmsCodeDto
=
this
.
checkSmsCode
(
parameter
.
getMobile
(),
parameter
.
getCode
());
if
(!
checkSmsCodeDto
.
isSuccess
())
{
return
checkSmsCodeDto
;
}
ResponseDto
<
AdamUserInfoVo
>
registerRespDto
=
adamUserService
.
register
(
parameter
);
if
(!
registerRespDto
.
isSuccess
())
{
return
ResponseDto
.
failure
(
registerRespDto
.
getCode
(),
registerRespDto
.
getMessage
());
}
else
{
AdamUserInfoVo
registerUserInfo
=
registerRespDto
.
getData
();
loginInfoVo
.
setUserInfo
(
registerUserInfo
);
loginInfoVo
.
setThirdPartInfo
(
adamRdmService
.
getThirdPartVoListByUid
(
registerUserInfo
.
getUid
()));
// loginInfoVo.setMemberVo(adamRdmService.getMemberSimpleVo());
}
toRegister
=
true
;
}
loginInfoVo
.
setToken
(
this
.
ssoProcess
(
loginInfoVo
.
getUserInfo
()));
loginInfoVo
.
getUserInfo
().
setMobile
(
SensitizeUtil
.
custom
(
loginInfoVo
.
getUserInfo
().
getMobile
(),
3
,
4
));
log
.
info
(
UserPathDto
.
setData
(
toRegister
?
"注册"
:
"登录"
,
ServletUtils
.
getRequest
().
getParameterMap
(),
loginInfoVo
));
return
ResponseDto
.
success
(
loginInfoVo
);
}
@ApiOperationSupport
(
order
=
7
)
@ApiOperation
(
value
=
"登出"
)
@ApiOperation
(
value
=
"登出"
)
@PostMapping
(
value
=
{
"out"
})
@PostMapping
(
value
=
{
"out"
})
public
void
logout
()
{
public
void
logout
()
{
...
@@ -307,7 +345,7 @@ public class AdamLoginController {
...
@@ -307,7 +345,7 @@ public class AdamLoginController {
redisUtil
.
del
(
jwtValidator
.
getSsoRedisKey
().
concat
(
CurrentUtil
.
getCurrentUid
()));
redisUtil
.
del
(
jwtValidator
.
getSsoRedisKey
().
concat
(
CurrentUtil
.
getCurrentUid
()));
}
}
@ApiOperationSupport
(
order
=
7
)
@ApiOperationSupport
(
order
=
8
)
@ApiOperation
(
value
=
"注销"
)
@ApiOperation
(
value
=
"注销"
)
@PostMapping
(
value
=
{
"close"
})
@PostMapping
(
value
=
{
"close"
})
public
ResponseDto
<
Object
>
close
()
{
public
ResponseDto
<
Object
>
close
()
{
...
@@ -320,14 +358,14 @@ public class AdamLoginController {
...
@@ -320,14 +358,14 @@ public class AdamLoginController {
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
@ApiOperationSupport
(
order
=
8
)
@ApiOperationSupport
(
order
=
9
)
@ApiOperation
(
value
=
"时间戳"
)
@ApiOperation
(
value
=
"时间戳"
)
@GetMapping
(
value
=
{
"ts"
})
@GetMapping
(
value
=
{
"ts"
})
public
ResponseDto
<
Long
>
timestamp
()
{
public
ResponseDto
<
Long
>
timestamp
()
{
return
ResponseDto
.
success
(
LocalDateTime
.
now
().
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
());
return
ResponseDto
.
success
(
LocalDateTime
.
now
().
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
());
}
}
@ApiOperationSupport
(
order
=
9
)
@ApiOperationSupport
(
order
=
10
)
@ApiOperation
(
value
=
"微信小程序登录凭证校验"
,
notes
=
"这里仅用于获取OPENID使用。登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html"
)
@ApiOperation
(
value
=
"微信小程序登录凭证校验"
,
notes
=
"这里仅用于获取OPENID使用。登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html"
)
@GetMapping
(
value
=
{
"wxa/code2session"
})
@GetMapping
(
value
=
{
"wxa/code2session"
})
public
ResponseDto
<
String
>
wxaCode2Session
(
@RequestParam
String
jsCode
)
{
public
ResponseDto
<
String
>
wxaCode2Session
(
@RequestParam
String
jsCode
)
{
...
@@ -350,7 +388,7 @@ public class AdamLoginController {
...
@@ -350,7 +388,7 @@ public class AdamLoginController {
return
ResponseDto
.
success
(
openId
);
return
ResponseDto
.
success
(
openId
);
}
}
@ApiOperationSupport
(
order
=
1
0
)
@ApiOperationSupport
(
order
=
1
1
)
@ApiOperation
(
value
=
"微信网站应用登录"
,
notes
=
"这里仅用于获取OPENID使用。方法详见 https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html"
)
@ApiOperation
(
value
=
"微信网站应用登录"
,
notes
=
"这里仅用于获取OPENID使用。方法详见 https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html"
)
@GetMapping
(
value
=
{
"wx/oauth2/access_token"
})
@GetMapping
(
value
=
{
"wx/oauth2/access_token"
})
public
ResponseDto
<
String
>
wxOauth2AccessToken
(
@RequestParam
String
code
)
{
public
ResponseDto
<
String
>
wxOauth2AccessToken
(
@RequestParam
String
code
)
{
...
...
张国柄
@zhangguobing
mentioned in commit
a0f6b27e
·
Aug 05, 2021
mentioned in commit
a0f6b27e
mentioned in commit a0f6b27ebcc33d92e2fceab8105a86ddb3365e8e
Toggle commit list
张国柄
@zhangguobing
mentioned in commit
fdb00783
·
Aug 05, 2021
mentioned in commit
fdb00783
mentioned in commit fdb00783ea19fdd1c02a742f7f5fb0e14ac62d5e
Toggle commit list
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