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
62089f10
Commit
62089f10
authored
Dec 25, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
c0d7284f
5bf3327d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
14 deletions
+50
-14
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+1
-1
RedisKey.java
.../com/github/wxiaoqi/security/admin/constant/RedisKey.java
+4
-0
AppUserPositionTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
+9
-12
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+36
-1
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
62089f10
...
@@ -29,7 +29,7 @@ public interface IUserService {
...
@@ -29,7 +29,7 @@ public interface IUserService {
AppUserInfo
AppValidate
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
AppUserInfo
AppValidate
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
@RequestMapping
(
value
=
"/api/app/user/sendsms"
,
method
=
RequestMethod
.
POST
)
@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"
)
String
pointList
);
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
)
@RequestMapping
(
value
=
"/api/app/user/register"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
register
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
public
JSONObject
register
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/constant/RedisKey.java
View file @
62089f10
...
@@ -7,10 +7,14 @@ public class RedisKey {
...
@@ -7,10 +7,14 @@ public class RedisKey {
*/
*/
public
static
final
String
CONSTANT_CODE_PREFIX
=
"cache:mobilecode:"
;
public
static
final
String
CONSTANT_CODE_PREFIX
=
"cache:mobilecode:"
;
/**
/**
* 图片验证码
* 图片验证码
*/
*/
public
static
final
String
CAPTCHA_PHONE_PREFIX
=
"captcha:phone:"
;
public
static
final
String
CAPTCHA_PHONE_PREFIX
=
"captcha:phone:"
;
public
static
final
String
CONSTANT_ERROR_PREFIX
=
"cache:mobileerror:"
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
View file @
62089f10
...
@@ -105,10 +105,8 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
...
@@ -105,10 +105,8 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
userPositionTemp
.
setCompanyName
(
companyName
);
userPositionTemp
.
setCompanyName
(
companyName
);
//编辑
//编辑
if
(
id
==
null
||
id
==
0
)
{
if
(
id
==
null
||
id
==
0
)
{
int
ids
=
addUserFindId
(
userPositionTemp
).
getId
();
insertSelective
(
userPositionTemp
);
appUserPositionTempDTO
.
setId
(
ids
);
//记录表插入
//记录表插入
// appUserPositionTempDTO.setId();
appUserPositionChangeRecordBiz
.
addJoinJobRecord
(
appUserPositionTempDTO
,
updUserId
);
appUserPositionChangeRecordBiz
.
addJoinJobRecord
(
appUserPositionTempDTO
,
updUserId
);
}
else
{
}
else
{
updateSelectiveById
(
userPositionTemp
);
updateSelectiveById
(
userPositionTemp
);
...
@@ -196,7 +194,7 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
...
@@ -196,7 +194,7 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
return
dataVO
;
return
dataVO
;
}
}
public
Map
<
String
,
Object
>
importUserPostion
(
List
<
String
[]>
userPostionData
,
Integer
operatorId
)
{
public
Map
<
String
,
Object
>
importUserPostion
(
List
<
String
[]>
userPostionData
,
Integer
operatorId
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
2
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
2
);
List
<
Map
<
String
,
Object
>>
errorResult
=
Lists
.
newArrayList
();
List
<
Map
<
String
,
Object
>>
errorResult
=
Lists
.
newArrayList
();
Map
<
String
,
Object
>
errorResultMap
;
Map
<
String
,
Object
>
errorResultMap
;
...
@@ -277,14 +275,13 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
...
@@ -277,14 +275,13 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
appUserPositionTemp
.
setId
(
id
);
appUserPositionTemp
.
setId
(
id
);
updateSelectiveById
(
appUserPositionTemp
);
updateSelectiveById
(
appUserPositionTemp
);
}
else
{
}
else
{
// insertSelective(appUserPositionTemp);
// insertSelective(appUserPositionTemp);
AppUserPositionTemp
appUserPositionTempNew
=
new
AppUserPositionTemp
();
AppUserPositionTemp
appUserPositionTempNew
=
new
AppUserPositionTemp
();
BeanUtils
.
copyProperties
(
appUserPositionTemp
,
appUserPositionTempNew
);
BeanUtils
.
copyProperties
(
appUserPositionTemp
,
appUserPositionTempNew
);
appUserPositionTempNew
=
addUserFindId
(
appUserPositionTemp
);
appUserPositionTempNew
=
addUserFindId
(
appUserPositionTemp
);
//记录表插入
//记录表插入
appUserPositionChangeRecordBiz
.
addJoinJobRecord
(
appUserPositionTempNew
,
operatorId
);
appUserPositionChangeRecordBiz
.
addJoinJobRecord
(
appUserPositionTempNew
,
operatorId
);
}
}
}
catch
(
BaseException
ex
)
{
}
catch
(
BaseException
ex
)
{
errorResultMap
=
new
HashMap
<>(
1
);
errorResultMap
=
new
HashMap
<>(
1
);
errorResultMap
.
put
(
"num"
,
i
);
errorResultMap
.
put
(
"num"
,
i
);
...
@@ -442,12 +439,12 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
...
@@ -442,12 +439,12 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
}
}
//身份变更
//身份变更
if
(
StaffChangeStatusEnum
.
IDENTITY_CHANE
.
getCode
()
==
changeStatus
)
{
if
(
StaffChangeStatusEnum
.
IDENTITY_CHANE
.
getCode
()
==
changeStatus
)
{
//不是离职状态下
//不是离职状态下
if
(
Objects
.
nonNull
(
userPositionTemp
.
getIsQuit
())
&&
userPositionTemp
.
getIsQuit
()
!=
1
)
{
if
(
Objects
.
nonNull
(
userPositionTemp
.
getIsQuit
())
&&
userPositionTemp
.
getIsQuit
()!=
1
)
{
postionId
=
Objects
.
nonNull
(
postionId
)
?
postionId
:
appUserPositionTempDTO
.
getPositionId
();
postionId
=
Objects
.
nonNull
(
postionId
)
?
postionId
:
appUserPositionTempDTO
.
getPositionId
();
//更改为股东身份
//更改为股东身份
loginBiz
.
updateUserPosition
(
appUserDetail
.
getUserid
(),
postionId
);
loginBiz
.
updateUserPosition
(
appUserDetail
.
getUserid
(),
postionId
);
}
}
}
}
}
}
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
62089f10
...
@@ -118,6 +118,9 @@ public class AppPermissionService {
...
@@ -118,6 +118,9 @@ public class AppPermissionService {
private
AppUserAlipayBiz
alipayBiz
;
private
AppUserAlipayBiz
alipayBiz
;
private
static
final
Integer
maxNumber
=
5
;
public
AppUserInfo
validate
(
String
username
,
String
password
)
{
public
AppUserInfo
validate
(
String
username
,
String
password
)
{
AppUserInfo
info
=
new
AppUserInfo
();
AppUserInfo
info
=
new
AppUserInfo
();
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
...
@@ -259,13 +262,16 @@ public class AppPermissionService {
...
@@ -259,13 +262,16 @@ public class AppPermissionService {
if
(
StringUtils
.
isNotBlank
(
code
)){
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
if
(
codes
.
length
>
0
)
{
String
userCode
=
codes
[
0
];
String
userCode
=
codes
[
0
];
if
(
appUserDetailBiz
.
getUserByCode
(
userCode
)==
0
)
{
if
(
appUserDetailBiz
.
getUserByCode
(
userCode
)==
0
)
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请人不存在"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请人不存在"
);
}
}
}
}
}
}
/*if (checkErrorNum(username)){
return JsonResultUtil.createFailedResult(ResultCode.FAILED_CODE, "验证码超过错误次数");
}*/
String
redisLockKey
=
RedisKey
.
CONSTANT_CODE_PREFIX
+
username
+
mobilecode
;
String
redisLockKey
=
RedisKey
.
CONSTANT_CODE_PREFIX
+
username
+
mobilecode
;
String
mobilecodeRedis
=
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
)
==
null
?
""
:
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
).
toString
();
String
mobilecodeRedis
=
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
)
==
null
?
""
:
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
).
toString
();
log
.
info
(
"注册接口,获取redis中的验证码:"
+
mobilecodeRedis
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
log
.
info
(
"注册接口,获取redis中的验证码:"
+
mobilecodeRedis
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
...
@@ -591,6 +597,7 @@ public class AppPermissionService {
...
@@ -591,6 +597,7 @@ public class AppPermissionService {
// 获取到缓存的验证码后要先清空缓存对应键的值
// 获取到缓存的验证码后要先清空缓存对应键的值
userRedisTemplate
.
delete
(
redisLockKey
);
userRedisTemplate
.
delete
(
redisLockKey
);
if
(
StringUtils
.
isBlank
(
mobilecodeRedis
))
{
if
(
StringUtils
.
isBlank
(
mobilecodeRedis
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"验证码错误"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"验证码错误"
);
}
}
Long
now
=
System
.
currentTimeMillis
()
/
1000
;
Long
now
=
System
.
currentTimeMillis
()
/
1000
;
...
@@ -675,6 +682,34 @@ public class AppPermissionService {
...
@@ -675,6 +682,34 @@ public class AppPermissionService {
}
}
public
void
setErrorNum
(
String
username
){
String
redisLockKey
=
RedisKey
.
CONSTANT_ERROR_PREFIX
+
username
;
Integer
number
=
getErrorNum
(
username
,
redisLockKey
);
userRedisTemplate
.
delete
(
redisLockKey
);
Boolean
suc
=
userRedisTemplate
.
opsForValue
().
setIfAbsent
(
redisLockKey
,
number
+
1
);
if
(
suc
)
{
userRedisTemplate
.
expire
(
redisLockKey
,
5
,
TimeUnit
.
MINUTES
);
//5分钟内过期
}
}
public
boolean
checkErrorNum
(
String
username
){
String
redisLockKey
=
RedisKey
.
CONSTANT_ERROR_PREFIX
+
username
;
Integer
number
=
getErrorNum
(
username
,
redisLockKey
);
if
(
number
>=
maxNumber
){
return
true
;
}
return
false
;
}
public
Integer
getErrorNum
(
String
username
,
String
redisLockKey
){
String
errorNum
=
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
)
==
null
?
"0"
:
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
).
toString
();
Integer
number
=
0
;
if
(
StringUtils
.
isNotBlank
(
errorNum
)){
number
=
Integer
.
parseInt
(
errorNum
);
}
return
number
;
}
/**
/**
* 校验手机号码是否已绑定微信
* 校验手机号码是否已绑定微信
*
*
...
...
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