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
5226d818
Commit
5226d818
authored
Dec 21, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
264c65fa
14d5a277
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
31 deletions
+22
-31
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+3
-11
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+1
-1
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+3
-6
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+4
-7
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+2
-2
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+1
-1
CaptchaController.java
...xxfc/platform/universal/controller/CaptchaController.java
+5
-0
ClickWordCaptcha.java
...com/xxfc/platform/universal/service/ClickWordCaptcha.java
+3
-3
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
5226d818
...
...
@@ -5,22 +5,14 @@ import com.github.wxiaoqi.security.auth.service.AuthService;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.common.constant.RequestTypeConstants
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.ClientUtil
;
import
com.github.wxiaoqi.security.common.util.EntityUtils
;
import
com.github.wxiaoqi.security.common.util.IpUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
...
...
@@ -83,9 +75,9 @@ public class AuthController {
return
new
ObjectRestResponse
<>();
}
@RequestMapping
(
value
=
"/sendsms"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
sendsms
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
)
throws
Exception
{
public
JSONObject
sendsms
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
String
pointList
)
throws
Exception
{
log
.
info
(
username
+
"----require sendsms..."
);
return
appAuthService
.
sendsms
(
username
,
type
);
return
appAuthService
.
sendsms
(
username
,
type
,
pointList
);
}
@RequestMapping
(
value
=
"/register"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
register
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
...
...
@@ -180,7 +172,7 @@ public class AuthController {
@RequestMapping
(
value
=
"other/sendsms"
,
method
=
RequestMethod
.
GET
)
public
JSONObject
otherSendsms
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
)
throws
Exception
{
log
.
info
(
username
+
"----require sendsms..."
);
return
appAuthService
.
sendsms
(
username
,
type
);
return
appAuthService
.
sendsms
(
username
,
type
,
""
);
}
@RequestMapping
(
value
=
"/otherLogin"
,
method
=
RequestMethod
.
POST
)
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
5226d818
...
...
@@ -29,7 +29,7 @@ public interface IUserService {
AppUserInfo
AppValidate
(
@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
);
public
JSONObject
sendsms
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"pointList"
)
String
pointList
);
@RequestMapping
(
value
=
"/api/app/user/register"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
register
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
5226d818
...
...
@@ -4,18 +4,15 @@ package com.github.wxiaoqi.security.auth.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.servlet.http.HttpServletRequest
;
public
interface
AuthService
{
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
String
refresh
(
String
oldToken
)
throws
Exception
;
void
validate
(
String
token
)
throws
Exception
;
JSONObject
sendsms
(
String
username
,
Integer
type
)
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
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
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 @
5226d818
...
...
@@ -13,14 +13,11 @@ import com.github.wxiaoqi.security.common.constant.RequestTypeConstants;
import
com.github.wxiaoqi.security.common.exception.auth.UserInvalidException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author keliii
*/
...
...
@@ -69,17 +66,17 @@ public class AppAuthServiceImpl implements AuthService {
jwtTokenUtil
.
getInfoFromToken
(
token
);
}
@Override
public
JSONObject
sendsms
(
String
username
,
Integer
type
)
throws
Exception
{
return
userService
.
sendsms
(
username
,
type
);
public
JSONObject
sendsms
(
String
username
,
Integer
type
,
String
pointList
)
throws
Exception
{
return
userService
.
sendsms
(
username
,
type
,
pointList
);
}
@Override
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
{
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
{
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
);
}
@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
{
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
);
}
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
5226d818
...
...
@@ -65,8 +65,8 @@ public class AuthServiceImpl implements AuthService {
return
jwtTokenUtil
.
generateToken
(
jwtTokenUtil
.
getInfoFromToken
(
oldToken
));
}
@Override
public
JSONObject
sendsms
(
String
username
,
Integer
type
)
throws
Exception
{
return
userService
.
sendsms
(
username
,
type
);
public
JSONObject
sendsms
(
String
username
,
Integer
type
,
String
pointList
)
throws
Exception
{
return
userService
.
sendsms
(
username
,
type
,
pointList
);
}
@Override
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
5226d818
...
...
@@ -71,7 +71,7 @@ public class AppUserRest {
*/
@RequestMapping
(
value
=
"/user/sendsms"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
JSONObject
sendsms
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
String
pointList
){
JSONObject
sendsms
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"pointList"
)
String
pointList
){
return
appPermissionService
.
sendSMS
(
username
,
type
,
pointList
);
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/CaptchaController.java
View file @
5226d818
...
...
@@ -57,9 +57,14 @@ public class CaptchaController {
captchaBaseParam
.
setUrlOrPath
(
ImageUtils
.
getClickWordBgPath
());
captcha
.
setFontColorRandom
(
false
);
ClickWordCaptchaVO
dataVO
=
(
ClickWordCaptchaVO
)
captcha
.
create
(
captchaBaseParam
);
log
.
info
(
"获取注册验证码:》》》{}"
,
dataVO
.
getPointList
());
if
(
dataVO
.
getPointList
()
!=
null
)
{
try
{
String
redisLockKey
=
RedisKey
.
CAPTCHA_PHONE_PREFIX
+
phone
;
String
captchaCode
=
redisTemplate
.
opsForValue
().
get
(
redisLockKey
)
==
null
?
""
:
redisTemplate
.
opsForValue
().
get
(
redisLockKey
).
toString
();
if
(
StringUtils
.
isNotBlank
(
captchaCode
))
{
redisTemplate
.
delete
(
redisLockKey
);
}
Boolean
suc
=
redisTemplate
.
opsForValue
().
setIfAbsent
(
redisLockKey
,
JSONArray
.
toJSONString
(
dataVO
.
getPointList
()));
if
(
suc
)
{
redisTemplate
.
expire
(
redisLockKey
,
5
,
TimeUnit
.
MINUTES
);
//5分钟内过期
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/ClickWordCaptcha.java
View file @
5226d818
...
...
@@ -58,11 +58,11 @@ public class ClickWordCaptcha extends AbstractCaptcha {
int
x1
=
(
int
)
point1
.
getX
();
int
y1
=
(
int
)
point1
.
getY
();
if
(
Math
.
abs
(
x
-
x1
)
>=
HAN_ZI_SIZE_HALF
||
Math
.
abs
(
y
-
y1
)
>
=
HAN_ZI_SIZE_HALF
){
return
fals
e
;
if
(
Math
.
abs
(
x
-
x1
)
<=
HAN_ZI_SIZE_HALF
&&
Math
.
abs
(
y
-
y1
)
<
=
HAN_ZI_SIZE_HALF
){
return
tru
e
;
}
}
return
tru
e
;
return
fals
e
;
}
private
ClickWordCaptchaVO
getImageData
(
BufferedImage
backgroundImage
)
{
...
...
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