Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
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
lanbaoming
jiedao-api-boot-master
Commits
3555856c
Commit
3555856c
authored
Oct 17, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(600): 分享页面注册
parent
921ced92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
AppAuthController.java
.../module/member/controller/app/auth/AppAuthController.java
+16
-3
MemberAuthService.java
...r/yudao/module/member/service/auth/MemberAuthService.java
+1
-1
MemberAuthServiceImpl.java
...dao/module/member/service/auth/MemberAuthServiceImpl.java
+4
-1
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java
View file @
3555856c
...
...
@@ -50,11 +50,24 @@ public class AppAuthController {
// if (StringUtils.isNotBlank(mobile)) {
// reqVO.setMobile(mobile);
// }
String
token
=
authService
.
reg
(
reqVO
,
getClientIP
(),
getUserAgent
());
String
token
=
authService
.
reg
(
reqVO
,
getClientIP
(),
getUserAgent
()
,
true
);
// 返回结果
return
success
(
AppAuthLoginRespVO
.
builder
().
token
(
token
).
build
());
}
@PostMapping
(
"/share-page/reg"
)
@ApiOperation
(
"分享页面使用手机注册"
)
@OperateLog
(
enable
=
false
)
@Idempotent
(
timeout
=
5
)
public
CommonResult
<
Boolean
>
sharePageReg
(
@RequestBody
@Valid
AppAuthRegReqVO
reqVO
)
{
String
mobileCode
=
reqVO
.
getAreaCode
()
+
StrUtil
.
COLON
+
reqVO
.
getMobile
();
paramValidatorApi
.
validatorMobile
(
mobileCode
);
authService
.
reg
(
reqVO
,
getClientIP
(),
getUserAgent
(),
false
);
// 返回结果
return
success
(
true
);
}
@PostMapping
(
"/login"
)
@ApiOperation
(
"使用手机 + 密码登录"
)
@OperateLog
(
enable
=
false
)
// 避免 Post 请求被记录操作日志
...
...
@@ -110,7 +123,7 @@ public class AppAuthController {
}
@PostMapping
(
"/update-password"
)
@ApiOperation
(
value
=
"修改用户密码"
,
notes
=
"用户修改密码时使用"
)
@ApiOperation
(
value
=
"修改用户密码"
,
notes
=
"用户修改密码时使用"
)
@PreAuthenticated
@Idempotent
(
timeout
=
5
)
public
CommonResult
<
Boolean
>
updatePassword
(
@RequestBody
@Valid
AppAuthUpdatePasswordReqVO
reqVO
)
{
...
...
@@ -129,7 +142,7 @@ public class AppAuthController {
}
@PostMapping
(
"/update-control-password"
)
@ApiOperation
(
value
=
"修改用户控货密码"
,
notes
=
"用户修改控货密码时使用"
)
@ApiOperation
(
value
=
"修改用户控货密码"
,
notes
=
"用户修改控货密码时使用"
)
@PreAuthenticated
public
CommonResult
<
Boolean
>
updateControlPassword
(
@RequestBody
@Valid
AppAuthUpdatePasswordReqVO
reqVO
)
{
authService
.
updateControlPassword
(
getLoginUserId
(),
reqVO
);
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java
View file @
3555856c
...
...
@@ -22,7 +22,7 @@ public interface MemberAuthService extends SecurityAuthFrameworkService {
* @param userAgent 用户 UA
* @return 身份令牌,使用 JWT 方式
*/
String
reg
(
@Valid
AppAuthRegReqVO
reqVO
,
String
userIp
,
String
userAgent
);
String
reg
(
@Valid
AppAuthRegReqVO
reqVO
,
String
userIp
,
String
userAgent
,
Boolean
isAutoLogin
);
/**
* 检查号码是否唯一
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java
View file @
3555856c
...
...
@@ -111,7 +111,7 @@ public class MemberAuthServiceImpl implements MemberAuthService {
}
@Override
public
String
reg
(
@Valid
AppAuthRegReqVO
reqVO
,
String
userIp
,
String
userAgent
)
{
public
String
reg
(
@Valid
AppAuthRegReqVO
reqVO
,
String
userIp
,
String
userAgent
,
Boolean
isAutoLogin
)
{
// 校验验证码
smsCodeApi
.
useSmsCode
(
AuthConvert
.
INSTANCE
.
convert
(
reqVO
,
SmsSceneEnum
.
MEMBER_REG
.
getScene
(),
userIp
));
...
...
@@ -134,6 +134,9 @@ public class MemberAuthServiceImpl implements MemberAuthService {
.
setContent
(
"手机注册成功"
);
userOperationLogService
.
createUserOperationLog
(
userOperationLogCreateReqVO
);
if
(!
isAutoLogin
)
{
return
null
;
}
// 执行登陆
this
.
createLoginLog
(
user
.
getMobile
(),
LoginLogTypeEnum
.
LOGIN_USERNAME
,
LoginResultEnum
.
SUCCESS
);
LoginUser
loginUser
=
AuthConvert
.
INSTANCE
.
convert
(
user
);
...
...
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