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
2a9e22c0
Commit
2a9e22c0
authored
Dec 13, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_guanjia'
parents
66704eb6
a76a26b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+36
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+1
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
2a9e22c0
...
@@ -23,6 +23,7 @@ import org.springframework.web.context.request.RequestContextHolder;
...
@@ -23,6 +23,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
@Api
(
tags
=
"用户登录"
)
@Api
(
tags
=
"用户登录"
)
@RestController
@RestController
...
@@ -172,6 +173,41 @@ public class AuthController {
...
@@ -172,6 +173,41 @@ public class AuthController {
}
}
return
data
;
return
data
;
}
}
@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
);
}
@RequestMapping
(
value
=
"/otherLogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
otherLogin
(
@RequestBody
Map
<
String
,
Object
>
params
)
throws
Exception
{
log
.
info
(
"----require otherLogin..."
);
String
username
=
params
.
get
(
"username"
)==
null
?
""
:
params
.
get
(
"username"
).
toString
();
String
mobilecode
=
params
.
get
(
"mobilecode"
)==
null
?
""
:
params
.
get
(
"mobilecode"
).
toString
();
String
password
=
params
.
get
(
"password"
)==
null
?
""
:
params
.
get
(
"password"
).
toString
();
Integer
type
=
params
.
get
(
"type"
)==
null
?
1
:
params
.
get
(
"type"
).
hashCode
();
String
code
=
params
.
get
(
"code"
)==
null
?
""
:
params
.
get
(
"code"
).
toString
();
JSONObject
data
=
appAuthService
.
tlogin
(
username
,
password
,
mobilecode
,
type
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
}
else
{
Integer
positionId
=
result
.
getInteger
(
"positionId"
)==
null
?
0
:
result
.
getInteger
(
"positionId"
);
if
(
positionId
==
4
||
positionId
==
1
||
positionId
==
2
||
positionId
==
3
){
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"userId"
));
data
.
put
(
"token"
,
token
);
}
else
{
data
.
put
(
"status"
,
ResultCode
.
FAILED_CODE
);
data
.
put
(
"message"
,
"非内部员工,无法登录"
);
}
}
}
return
data
;
}
@RequestMapping
(
value
=
"/reset"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/reset"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
2a9e22c0
...
@@ -438,6 +438,7 @@ public class AppPermissionService {
...
@@ -438,6 +438,7 @@ public class AppPermissionService {
data
.
put
(
"userId"
,
userid
);
data
.
put
(
"userId"
,
userid
);
data
.
put
(
"imUserId"
,
userVo
.
getImUserid
());
data
.
put
(
"imUserId"
,
userVo
.
getImUserid
());
data
.
put
(
"code"
,
userVo
.
getCode
());
data
.
put
(
"code"
,
userVo
.
getCode
());
data
.
put
(
"positionId"
,
userVo
.
getPositionId
());
//更新登录时间 和 ip
//更新登录时间 和 ip
String
clientIp
=
getIp
();
String
clientIp
=
getIp
();
appUserLoginBiz
.
updateLoginInfo
(
userid
,
clientIp
);
appUserLoginBiz
.
updateLoginInfo
(
userid
,
clientIp
);
...
...
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