Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
Project
Project
Details
Activity
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
曲欣亮
member-api
Commits
e9aa114f
Commit
e9aa114f
authored
Nov 22, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xx
parent
98d89338
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
12 deletions
+12
-12
TokenService.java
src/main/java/com/egolm/film/api/TokenService.java
+1
-1
AdminLoginController.java
...n/java/com/egolm/film/api/admin/AdminLoginController.java
+1
-1
AdminTokenServiceImpl.java
...lm/film/api/admin/service/impl/AdminTokenServiceImpl.java
+1
-1
MemberLoginController.java
...java/com/egolm/film/api/member/MemberLoginController.java
+1
-1
MemberTokenServiceImpl.java
.../film/api/member/service/impl/MemberTokenServiceImpl.java
+1
-1
UserTokenServiceImpl.java
...golm/film/api/user/service/impl/UserTokenServiceImpl.java
+1
-1
AdminLoginInterceptor.java
.../egolm/film/config/interceptor/AdminLoginInterceptor.java
+2
-2
MemberLoginInterceptor.java
...egolm/film/config/interceptor/MemberLoginInterceptor.java
+2
-2
UserLoginInterceptor.java
...m/egolm/film/config/interceptor/UserLoginInterceptor.java
+2
-2
No files found.
src/main/java/com/egolm/film/api/TokenService.java
View file @
e9aa114f
...
@@ -18,5 +18,5 @@ public interface TokenService {
...
@@ -18,5 +18,5 @@ public interface TokenService {
boolean
isLoginByToken
(
String
token
);
boolean
isLoginByToken
(
String
token
);
void
l
og
(
HttpServletRequest
request
);
void
doL
og
(
HttpServletRequest
request
);
}
}
src/main/java/com/egolm/film/api/admin/AdminLoginController.java
View file @
e9aa114f
...
@@ -34,7 +34,7 @@ public class AdminLoginController {
...
@@ -34,7 +34,7 @@ public class AdminLoginController {
}
else
{
}
else
{
LoginToken
token
=
tokenService
.
doLogin
(
username
,
password
);
LoginToken
token
=
tokenService
.
doLogin
(
username
,
password
);
if
(
token
!=
null
)
{
if
(
token
!=
null
)
{
tokenService
.
l
og
(
request
);
tokenService
.
doL
og
(
request
);
return
Rjx
.
jsonOk
().
setData
(
token
);
return
Rjx
.
jsonOk
().
setData
(
token
);
}
else
{
}
else
{
throw
new
XException
(
"用户名或密码错误"
);
throw
new
XException
(
"用户名或密码错误"
);
...
...
src/main/java/com/egolm/film/api/admin/service/impl/AdminTokenServiceImpl.java
View file @
e9aa114f
...
@@ -101,7 +101,7 @@ public class AdminTokenServiceImpl implements AdminTokenService {
...
@@ -101,7 +101,7 @@ public class AdminTokenServiceImpl implements AdminTokenService {
}
}
@Override
@Override
public
void
l
og
(
HttpServletRequest
request
)
{
public
void
doL
og
(
HttpServletRequest
request
)
{
LoginToken
token
=
this
.
getToken
();
LoginToken
token
=
this
.
getToken
();
String
loginid
=
String
.
valueOf
(
token
.
getId
());
String
loginid
=
String
.
valueOf
(
token
.
getId
());
Date
now
=
new
Date
();
Date
now
=
new
Date
();
...
...
src/main/java/com/egolm/film/api/member/MemberLoginController.java
View file @
e9aa114f
...
@@ -43,7 +43,7 @@ public class MemberLoginController {
...
@@ -43,7 +43,7 @@ public class MemberLoginController {
}
else
{
}
else
{
LoginToken
token
=
tokenService
.
doLogin
(
username
,
password
);
LoginToken
token
=
tokenService
.
doLogin
(
username
,
password
);
if
(
token
!=
null
)
{
if
(
token
!=
null
)
{
tokenService
.
l
og
(
request
);
tokenService
.
doL
og
(
request
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
else
{
}
else
{
throw
new
XException
(
messages
.
get
(
"err.user_or_pwd"
));
throw
new
XException
(
messages
.
get
(
"err.user_or_pwd"
));
...
...
src/main/java/com/egolm/film/api/member/service/impl/MemberTokenServiceImpl.java
View file @
e9aa114f
...
@@ -105,7 +105,7 @@ public class MemberTokenServiceImpl implements MemberTokenService {
...
@@ -105,7 +105,7 @@ public class MemberTokenServiceImpl implements MemberTokenService {
}
}
@Override
@Override
public
void
l
og
(
HttpServletRequest
request
)
{
public
void
doL
og
(
HttpServletRequest
request
)
{
LoginToken
token
=
this
.
getToken
();
LoginToken
token
=
this
.
getToken
();
String
loginid
=
String
.
valueOf
(
token
.
getId
());
String
loginid
=
String
.
valueOf
(
token
.
getId
());
Date
now
=
new
Date
();
Date
now
=
new
Date
();
...
...
src/main/java/com/egolm/film/api/user/service/impl/UserTokenServiceImpl.java
View file @
e9aa114f
...
@@ -96,7 +96,7 @@ public class UserTokenServiceImpl implements UserTokenService {
...
@@ -96,7 +96,7 @@ public class UserTokenServiceImpl implements UserTokenService {
}
}
@Override
@Override
public
void
l
og
(
HttpServletRequest
request
)
{
public
void
doL
og
(
HttpServletRequest
request
)
{
LoginToken
token
=
this
.
getToken
();
LoginToken
token
=
this
.
getToken
();
String
loginid
=
String
.
valueOf
(
token
.
getId
());
String
loginid
=
String
.
valueOf
(
token
.
getId
());
Date
now
=
new
Date
();
Date
now
=
new
Date
();
...
...
src/main/java/com/egolm/film/config/interceptor/AdminLoginInterceptor.java
View file @
e9aa114f
...
@@ -21,7 +21,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
...
@@ -21,7 +21,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
if
(
tokenService
.
isLogin
())
{
if
(
tokenService
.
isLogin
())
{
tokenService
.
l
og
(
req
);
tokenService
.
doL
og
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
else
{
}
else
{
String
sessionid
=
null
;
String
sessionid
=
null
;
...
@@ -32,7 +32,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
...
@@ -32,7 +32,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
}
}
}
}
if
(
sessionid
!=
null
&&
tokenService
.
isLoginByToken
(
sessionid
))
{
if
(
sessionid
!=
null
&&
tokenService
.
isLoginByToken
(
sessionid
))
{
tokenService
.
l
og
(
req
);
tokenService
.
doL
og
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
}
throw
new
XException
(
"用户未登陆"
,
300
);
throw
new
XException
(
"用户未登陆"
,
300
);
...
...
src/main/java/com/egolm/film/config/interceptor/MemberLoginInterceptor.java
View file @
e9aa114f
...
@@ -21,7 +21,7 @@ public class MemberLoginInterceptor extends HandlerInterceptorAdapter {
...
@@ -21,7 +21,7 @@ public class MemberLoginInterceptor extends HandlerInterceptorAdapter {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
if
(
tokenService
.
isLogin
())
{
if
(
tokenService
.
isLogin
())
{
tokenService
.
l
og
(
req
);
tokenService
.
doL
og
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
else
{
}
else
{
String
sessionid
=
null
;
String
sessionid
=
null
;
...
@@ -32,7 +32,7 @@ public class MemberLoginInterceptor extends HandlerInterceptorAdapter {
...
@@ -32,7 +32,7 @@ public class MemberLoginInterceptor extends HandlerInterceptorAdapter {
}
}
}
}
if
(
sessionid
!=
null
&&
tokenService
.
isLoginByToken
(
sessionid
))
{
if
(
sessionid
!=
null
&&
tokenService
.
isLoginByToken
(
sessionid
))
{
tokenService
.
l
og
(
req
);
tokenService
.
doL
og
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
}
throw
new
XException
(
"用户未登陆"
,
300
);
throw
new
XException
(
"用户未登陆"
,
300
);
...
...
src/main/java/com/egolm/film/config/interceptor/UserLoginInterceptor.java
View file @
e9aa114f
...
@@ -21,7 +21,7 @@ public class UserLoginInterceptor extends HandlerInterceptorAdapter {
...
@@ -21,7 +21,7 @@ public class UserLoginInterceptor extends HandlerInterceptorAdapter {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
if
(
tokenService
.
isLogin
())
{
if
(
tokenService
.
isLogin
())
{
tokenService
.
l
og
(
req
);
tokenService
.
doL
og
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
else
{
}
else
{
String
sessionid
=
null
;
String
sessionid
=
null
;
...
@@ -32,7 +32,7 @@ public class UserLoginInterceptor extends HandlerInterceptorAdapter {
...
@@ -32,7 +32,7 @@ public class UserLoginInterceptor extends HandlerInterceptorAdapter {
}
}
}
}
if
(
sessionid
!=
null
&&
tokenService
.
isLoginByToken
(
sessionid
))
{
if
(
sessionid
!=
null
&&
tokenService
.
isLoginByToken
(
sessionid
))
{
tokenService
.
l
og
(
req
);
tokenService
.
doL
og
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
}
throw
new
XException
(
"用户未登陆"
,
300
);
throw
new
XException
(
"用户未登陆"
,
300
);
...
...
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