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
5eb42a70
Commit
5eb42a70
authored
Sep 24, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
20f0e52c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
16 deletions
+22
-16
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+7
-4
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+5
-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
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
5eb42a70
...
@@ -135,9 +135,11 @@ public class AuthController {
...
@@ -135,9 +135,11 @@ public class AuthController {
return
appAuthService
.
checkBindWechat
(
username
);
return
appAuthService
.
checkBindWechat
(
username
);
}
}
@RequestMapping
(
value
=
"/wxlogin"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/wxlogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
,
defaultValue
=
""
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
)
throws
Exception
{
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
,
defaultValue
=
""
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
)
throws
Exception
{
log
.
info
(
openid
+
"----require wxlogin..."
);
log
.
info
(
openid
+
"----require wxlogin..."
);
JSONObject
data
=
appAuthService
.
wxlogin
(
openid
,
isQQ
);
JSONObject
data
=
appAuthService
.
wxlogin
(
openid
,
isQQ
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
if
(
result
==
null
){
...
@@ -154,10 +156,11 @@ public class AuthController {
...
@@ -154,10 +156,11 @@ public class AuthController {
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
)
throws
Exception
{
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
)
throws
Exception
{
log
.
info
(
username
+
"----require login..."
);
log
.
info
(
username
+
"----require login..."
);
JSONObject
data
=
appAuthService
.
tlogin
(
username
,
password
,
mobilecode
,
type
);
JSONObject
data
=
appAuthService
.
tlogin
(
username
,
password
,
mobilecode
,
type
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
if
(
result
==
null
){
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
5eb42a70
...
@@ -42,12 +42,15 @@ public interface IUserService {
...
@@ -42,12 +42,15 @@ public interface IUserService {
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
);
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
);
@RequestMapping
(
value
=
"/api/app/user/login"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/login"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
)
String
username
,
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"password"
)
String
password
,
@RequestParam
(
value
=
"password"
)
String
password
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"type"
)
Integer
type
);
@RequestParam
(
value
=
"type"
)
Integer
type
,
@RequestParam
(
value
=
""
)
String
code
);
@RequestMapping
(
value
=
"/api/app/user/reset"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/reset"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
)
String
username
,
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
5eb42a70
...
@@ -15,8 +15,8 @@ public interface AuthService {
...
@@ -15,8 +15,8 @@ public interface AuthService {
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
)
throws
Exception
;
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
;
String
getToken
(
String
username
,
Integer
id
)
throws
Exception
;
String
getToken
(
String
username
,
Integer
id
)
throws
Exception
;
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
;
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
;
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
5eb42a70
...
@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService {
...
@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService {
}
}
@Override
@Override
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
{
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
);
return
userService
.
wxlogin
(
openid
,
isQQ
,
code
);
}
}
@Override
@Override
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
{
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
);
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
,
code
);
}
}
@Override
@Override
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
5eb42a70
...
@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService {
...
@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService {
}
}
@Override
@Override
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
{
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
);
return
userService
.
wxlogin
(
openid
,
isQQ
,
code
);
}
}
@Override
@Override
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
{
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
);
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
,
code
);
}
}
@Override
@Override
...
...
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