Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
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
周健威
rs-cloud-platform
Commits
0c1814a8
Commit
0c1814a8
authored
Sep 03, 2024
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动注册
parent
0de0ed4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+3
-0
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+2
-1
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+23
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+5
-1
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
0c1814a8
...
...
@@ -28,6 +28,9 @@ public interface IUserService {
@RequestMapping
(
value
=
"/api/app/user/validate"
,
method
=
RequestMethod
.
POST
)
AppUserInfo
AppValidate
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
@RequestMapping
(
value
=
"/api/app/user/validateMaxkey"
,
method
=
RequestMethod
.
POST
)
AppUserInfo
AppValidateMaxkey
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
@RequestMapping
(
value
=
"/api/app/user/sendsms"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
sendsms
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"pointList"
,
defaultValue
=
""
)
String
pointList
);
@RequestMapping
(
value
=
"/api/app/user/register"
,
method
=
RequestMethod
.
POST
)
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
0c1814a8
...
...
@@ -33,7 +33,8 @@ public class AppAuthServiceImpl implements AuthService {
@Override
public
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
{
AppUserInfo
info
=
userService
.
AppValidate
(
authenticationRequest
);
// AppUserInfo info = userService.AppValidate(authenticationRequest);
AppUserInfo
info
=
userService
.
AppValidateMaxkey
(
authenticationRequest
);
if
(
info
!=
null
&&!
StringUtils
.
isEmpty
(
info
.
getId
()))
{
// 在jwt中加入requestType
return
jwtTokenUtil
.
generateToken
(
new
JWTInfo
(
info
.
getUsername
(),
info
.
getId
()
+
""
,
info
.
getName
(),
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
0c1814a8
...
...
@@ -73,6 +73,29 @@ public class AppUserRest {
}
}
@RequestMapping
(
value
=
"/user/validateMaxkey"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
AppUserInfo
validateMaxkey
(
@RequestBody
Map
<
String
,
String
>
body
){
if
(
null
!=
body
.
get
(
"checkpass"
)
&&
body
.
get
(
"checkpass"
).
equals
(
"0"
))
{
AppUserInfo
info
=
new
AppUserInfo
();
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
body
.
get
(
"username"
));
if
(
user
!=
null
)
{
info
.
setUsername
(
user
.
getUsername
());
info
.
setId
(
user
.
getId
()
+
""
);
}
else
{
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
appPermissionService
.
registerCommon
(
body
.
get
(
"username"
),
"123456"
,
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
null
,
null
,
0
,
""
,
1
,
null
);
user
=
appUserLoginBiz
.
checkeUserLogin
(
body
.
get
(
"username"
));
info
.
setUsername
(
user
.
getUsername
());
info
.
setId
(
user
.
getId
()
+
""
);
}
return
info
;
}
else
{
return
appPermissionService
.
validate
(
body
.
get
(
"username"
),
body
.
get
(
"password"
));
}
}
/**
* 发送验证码
* @param username
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
0c1814a8
...
...
@@ -264,6 +264,10 @@ public class AppPermissionService {
if
(
StringUtils
.
isBlank
(
mobilecodeRedis
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"验证码错误"
);
}
return
registerCommon
(
username
,
password
,
headimgurl
,
nickname
,
openId
,
unionid
,
type
,
code
,
channel
,
activityCode
);
}
public
JSONObject
registerCommon
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
Integer
channel
,
String
activityCode
)
{
// 是否已存在
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
if
(
null
!=
user
)
{
...
...
@@ -313,7 +317,7 @@ public class AppPermissionService {
rsUserDetail
.
setChannel
(
channel
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
,
activityCode
,
1
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
,
activityCode
,
1
);
log
.
info
(
"注册:登录结果要做做统一处理: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
...
...
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