Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
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
youjj
cloud-platform
Commits
4d9cde1e
Commit
4d9cde1e
authored
Jan 13, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
5f608647
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
23 deletions
+35
-23
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+6
-4
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+4
-2
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+2
-2
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+4
-4
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+4
-4
AppUserDetail.java
...m/github/wxiaoqi/security/admin/entity/AppUserDetail.java
+4
-0
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+6
-4
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+5
-3
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
4d9cde1e
...
...
@@ -84,9 +84,10 @@ public class AuthController {
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
)
throws
Exception
{
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
Integer
registerSource
)
throws
Exception
{
log
.
info
(
username
+
"----require register..."
);
JSONObject
data
=
appAuthService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
);
JSONObject
data
=
appAuthService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
,
registerSource
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JwtAuthenticationRequest
authenticationRequest
=
new
JwtAuthenticationRequest
();
authenticationRequest
.
setUsername
(
username
);
...
...
@@ -108,11 +109,12 @@ public class AuthController {
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
Integer
registerSource
)
throws
Exception
{
log
.
info
(
username
+
"----require wxregister..."
);
JSONObject
data
=
appAuthService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
);
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
,
registerSource
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
4d9cde1e
...
...
@@ -35,7 +35,8 @@ public interface IUserService {
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"code"
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
);
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
Integer
registerSource
);
@RequestMapping
(
value
=
"/api/app/user/wxregister"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxregister
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
...
...
@@ -43,7 +44,8 @@ public interface IUserService {
@RequestParam
(
value
=
"headimgurl"
)
String
headimgurl
,
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"unionid"
)
String
unionid
,
@RequestParam
(
value
=
"type"
)
Integer
type
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
);
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
Integer
registerSource
);
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
4d9cde1e
...
...
@@ -11,8 +11,8 @@ public interface AuthService {
String
refresh
(
String
oldToken
)
throws
Exception
;
void
validate
(
String
token
)
throws
Exception
;
JSONObject
sendsms
(
String
username
,
Integer
type
,
String
pointList
)
throws
Exception
;
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
)
throws
Exception
;
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
,
Integer
registerSource
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
,
Integer
registerSource
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
;
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
4d9cde1e
...
...
@@ -72,13 +72,13 @@ public class AppAuthServiceImpl implements AuthService {
}
@Override
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
{
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
);
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
,
Integer
registerSource
)
throws
Exception
{
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
,
registerSource
);
}
@Override
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
)
throws
Exception
{
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
);
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
,
Integer
registerSource
)
throws
Exception
{
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
,
registerSource
);
}
@Override
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
4d9cde1e
...
...
@@ -69,13 +69,13 @@ public class AuthServiceImpl implements AuthService {
return
userService
.
sendsms
(
username
,
type
,
pointList
);
}
@Override
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
{
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
);
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
,
Integer
registerSource
)
throws
Exception
{
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
,
registerSource
);
}
@Override
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
)
throws
Exception
{
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
);
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
,
Integer
registerSource
)
throws
Exception
{
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
,
registerSource
);
}
@Override
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserDetail.java
View file @
4d9cde1e
...
...
@@ -86,4 +86,8 @@ public class AppUserDetail {
@ApiModelProperty
(
value
=
"1-新人用户;2-未激活;3-激活"
)
@Column
(
name
=
"state"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"注册来源"
)
@Column
(
name
=
"register_source"
)
private
Integer
registerSource
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
4d9cde1e
...
...
@@ -89,12 +89,13 @@ public class AppUserRest {
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
Integer
registerSource
){
//默认昵称
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
return
appPermissionService
.
register
(
username
,
password
,
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
mobilecode
,
null
,
null
,
0
,
code
,
channel
);
mobilecode
,
null
,
null
,
0
,
code
,
channel
,
registerSource
);
}
...
...
@@ -123,7 +124,8 @@ public class AppUserRest {
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
Integer
registerSource
){
if
(
StringUtils
.
isBlank
(
headimgurl
)){
headimgurl
=
SystemConfig
.
USER_HEADER_URL_DEFAULT
;
...
...
@@ -131,7 +133,7 @@ public class AppUserRest {
if
(
StringUtils
.
isBlank
(
nickname
)){
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
}
return
appPermissionService
.
weCahtRegister
(
username
,
password
,
openid
,
unionid
,
nickname
,
headimgurl
,
type
,
mobilecode
,
isQQ
,
code
,
channel
);
return
appPermissionService
.
weCahtRegister
(
username
,
password
,
openid
,
unionid
,
nickname
,
headimgurl
,
type
,
mobilecode
,
isQQ
,
code
,
channel
,
registerSource
);
}
/**
* 手机号码检测是否已绑定
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
4d9cde1e
...
...
@@ -251,7 +251,7 @@ public class AppPermissionService {
*/
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
JSONObject
register
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
Integer
channel
)
{
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
Integer
channel
,
Integer
registerSource
)
{
log
.
info
(
"register------code====="
+
code
+
"----开始进入方法---time===="
+
System
.
currentTimeMillis
()/
1000L
);
String
activityCode
=
null
;
// 判断参数和验证码
...
...
@@ -343,6 +343,7 @@ public class AppPermissionService {
//生成邀请码 长度改为8 不然重复率太高
rsUserDetail
.
setCode
(
ReferralCodeUtil
.
encode
(
userid
));
rsUserDetail
.
setChannel
(
channel
);
rsUserDetail
.
setRegisterSource
(
registerSource
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
info
(
"注册:新增用户详情: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
/* //绑定上下线关系
...
...
@@ -566,7 +567,7 @@ public class AppPermissionService {
*/
@Transactional
public
JSONObject
weCahtRegister
(
String
username
,
String
password
,
String
openId
,
String
unionid
,
String
nickname
,
String
headimgurl
,
int
type
,
String
mobilecode
,
Integer
isQQ
,
String
code
,
Integer
channel
)
{
String
unionid
,
String
nickname
,
String
headimgurl
,
int
type
,
String
mobilecode
,
Integer
isQQ
,
String
code
,
Integer
channel
,
Integer
registerSource
)
{
// 校验参数和验证码
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
...
...
@@ -626,6 +627,7 @@ public class AppPermissionService {
userDetail
.
setIsdel
(
0
);
userDetail
.
setCrtHost
(
getIp
());
userDetail
.
setChannel
(
channel
);
userDetail
.
setRegisterSource
(
registerSource
);
//setCreateIPInfo(userDetail);
appUserDetailBiz
.
insertSelective
(
userDetail
);
...
...
@@ -659,7 +661,7 @@ public class AppPermissionService {
}
}
else
if
(
type
==
2
)
{
// 新增
JSONObject
register
=
register
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
isQQ
,
code
,
channel
);
openId
,
unionid
,
isQQ
,
code
,
channel
,
registerSource
);
if
(
register
.
getInteger
(
"status"
)
!=
ResultCode
.
SUCCESS_CODE
)
{
if
(
register
.
getInteger
(
"status"
)
==
ResultCode
.
EXIST_CODE
)
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户已存在"
);
...
...
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