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
f1ec877a
Commit
f1ec877a
authored
Dec 11, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
d3899d0c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
10 deletions
+13
-10
AdminLoginController.java
...va/com/egolm/film/api/web/admin/AdminLoginController.java
+2
-1
MemberLoginController.java
.../com/egolm/film/api/web/member/MemberLoginController.java
+2
-1
UserLoginController.java
...java/com/egolm/film/api/web/user/UserLoginController.java
+2
-1
ExceptionHandler.java
src/main/java/com/egolm/film/config/ExceptionHandler.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/web/admin/AdminLoginController.java
View file @
f1ec877a
...
...
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.film.api.service.AdminTokenService
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.config.XRException
;
import
com.egolm.film.model.LoginToken
;
import
io.swagger.annotations.Api
;
...
...
@@ -30,7 +31,7 @@ public class AdminLoginController {
public
Object
login
(
String
username
,
String
password
,
HttpServletRequest
request
)
{
XException
.
assertNotBlank
(
"用户名或密码不能为空"
,
username
,
password
);
if
(
tokenService
.
isLogin
())
{
throw
new
XException
(
"用户已登录"
,
200
);
throw
new
X
R
Exception
(
"用户已登录"
,
200
);
}
else
{
LoginToken
token
=
tokenService
.
doLogin
(
username
,
password
);
if
(
token
!=
null
)
{
...
...
src/main/java/com/egolm/film/api/web/member/MemberLoginController.java
View file @
f1ec877a
...
...
@@ -12,6 +12,7 @@ import com.egolm.common.bean.Rjx;
import
com.egolm.film.api.service.MemberTokenService
;
import
com.egolm.film.api.service.Messages
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.config.XRException
;
import
com.egolm.film.model.LoginToken
;
import
io.swagger.annotations.Api
;
...
...
@@ -39,7 +40,7 @@ public class MemberLoginController {
public
Object
login
(
String
username
,
String
password
,
HttpServletRequest
request
)
{
XException
.
assertNotBlank
(
messages
.
get
(
"err.user_pwd_null"
),
username
,
password
);
if
(
tokenService
.
isLogin
())
{
throw
new
X
Exception
(
"
"
,
200
);
throw
new
X
RException
(
"用户已登陆
"
,
200
);
}
else
{
LoginToken
token
=
tokenService
.
doLogin
(
username
,
password
);
if
(
token
!=
null
)
{
...
...
src/main/java/com/egolm/film/api/web/user/UserLoginController.java
View file @
f1ec877a
...
...
@@ -10,6 +10,7 @@ import com.egolm.common.bean.Rjx;
import
com.egolm.film.api.service.Messages
;
import
com.egolm.film.api.service.UserTokenService
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.config.XRException
;
import
com.egolm.film.model.LoginToken
;
import
io.swagger.annotations.Api
;
...
...
@@ -32,7 +33,7 @@ public class UserLoginController {
public
Object
login
(
String
username
,
String
password
)
{
XException
.
assertNotBlank
(
messages
.
get
(
"err.user_pwd_null"
),
username
,
password
);
if
(
tokenService
.
isLogin
())
{
throw
new
X
Exception
(
"
"
,
200
);
throw
new
X
RException
(
"用户已登陆
"
,
200
);
}
else
{
LoginToken
token
=
tokenService
.
doLogin
(
username
,
password
);
if
(
token
!=
null
)
{
...
...
src/main/java/com/egolm/film/config/ExceptionHandler.java
View file @
f1ec877a
...
...
@@ -25,7 +25,7 @@ public class ExceptionHandler implements HandlerExceptionResolver {
if
(
ex
instanceof
XException
)
{
Rjx
rjx
=
((
XException
)
ex
).
getRjx
();
mav
.
addAllObjects
(
rjx
);
if
(
rjx
.
getCode
()
==
200
||
rjx
.
getCode
()
==
300
||
ex
instanceof
XRException
)
{
if
(
ex
instanceof
XRException
)
{
displayInLog
=
false
;
logger
.
debug
(
ex
.
getMessage
());
}
...
...
src/main/java/com/egolm/film/config/interceptor/AdminLoginInterceptor.java
View file @
f1ec877a
...
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.egolm.film.api.service.AdminTokenService
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.config.X
R
Exception
;
@Component
public
class
AdminLoginInterceptor
extends
HandlerInterceptorAdapter
{
...
...
@@ -36,7 +36,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
tokenService
.
doLog
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
throw
new
XException
(
"用户未登陆"
,
300
);
throw
new
X
R
Exception
(
"用户未登陆"
,
300
);
}
}
...
...
src/main/java/com/egolm/film/config/interceptor/MemberLoginInterceptor.java
View file @
f1ec877a
...
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.egolm.film.api.service.MemberTokenService
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.config.X
R
Exception
;
@Component
public
class
MemberLoginInterceptor
extends
HandlerInterceptorAdapter
{
...
...
@@ -36,7 +36,7 @@ public class MemberLoginInterceptor extends HandlerInterceptorAdapter {
tokenService
.
doLog
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
throw
new
XException
(
"用户未登陆"
,
300
);
throw
new
X
R
Exception
(
"用户未登陆"
,
300
);
}
}
...
...
src/main/java/com/egolm/film/config/interceptor/UserLoginInterceptor.java
View file @
f1ec877a
...
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.egolm.film.api.service.UserTokenService
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.config.X
R
Exception
;
@Component
public
class
UserLoginInterceptor
extends
HandlerInterceptorAdapter
{
...
...
@@ -34,7 +34,7 @@ public class UserLoginInterceptor extends HandlerInterceptorAdapter {
tokenService
.
doLog
(
req
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
throw
new
XException
(
"用户未登陆"
,
300
);
throw
new
X
R
Exception
(
"用户未登陆"
,
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