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
1aac2c7d
Commit
1aac2c7d
authored
Dec 11, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
c093be65
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
0 deletions
+8
-0
TokenService.java
src/main/java/com/egolm/film/api/service/TokenService.java
+5
-0
AdminTokenServiceImpl.java
...om/egolm/film/api/service/impl/AdminTokenServiceImpl.java
+1
-0
MemberTokenServiceImpl.java
...m/egolm/film/api/service/impl/MemberTokenServiceImpl.java
+1
-0
UserTokenServiceImpl.java
...com/egolm/film/api/service/impl/UserTokenServiceImpl.java
+1
-0
No files found.
src/main/java/com/egolm/film/api/service/TokenService.java
View file @
1aac2c7d
...
@@ -2,10 +2,15 @@ package com.egolm.film.api.service;
...
@@ -2,10 +2,15 @@ package com.egolm.film.api.service;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.egolm.film.model.LoginToken
;
import
com.egolm.film.model.LoginToken
;
public
interface
TokenService
{
public
interface
TokenService
{
Logger
logger
=
LoggerFactory
.
getLogger
(
TokenService
.
class
);
LoginToken
getToken
();
LoginToken
getToken
();
Object
getTokenObj
();
Object
getTokenObj
();
...
...
src/main/java/com/egolm/film/api/service/impl/AdminTokenServiceImpl.java
View file @
1aac2c7d
...
@@ -48,6 +48,7 @@ public class AdminTokenServiceImpl implements AdminTokenService {
...
@@ -48,6 +48,7 @@ public class AdminTokenServiceImpl implements AdminTokenService {
String
sql
=
"update fc_admin set token = ?, login_ip = ?, login_time = ? where adminid = ?"
;
String
sql
=
"update fc_admin set token = ?, login_ip = ?, login_time = ? where adminid = ?"
;
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
jdbcTemplate
.
executeUpdate
(
sql
,
cookie
.
getValue
(),
loginIp
,
System
.
currentTimeMillis
()/
1000
,
adminid
);
jdbcTemplate
.
executeUpdate
(
sql
,
cookie
.
getValue
(),
loginIp
,
System
.
currentTimeMillis
()/
1000
,
adminid
);
logger
.
debug
(
"admin login success: "
+
username
);
}
}
return
token
;
return
token
;
}
else
if
(
state
==
2
)
{
}
else
if
(
state
==
2
)
{
...
...
src/main/java/com/egolm/film/api/service/impl/MemberTokenServiceImpl.java
View file @
1aac2c7d
...
@@ -56,6 +56,7 @@ public class MemberTokenServiceImpl implements MemberTokenService {
...
@@ -56,6 +56,7 @@ public class MemberTokenServiceImpl implements MemberTokenService {
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
memberService
.
updateLoginInfo
(
id
,
loginIp
,
cookie
.
getValue
());
memberService
.
updateLoginInfo
(
id
,
loginIp
,
cookie
.
getValue
());
}
}
logger
.
debug
(
"member login success: "
+
email
);
return
token
;
return
token
;
}
else
{
}
else
{
throw
new
XException
(
messages
.
get
(
"err.user_pwd_err"
));
throw
new
XException
(
messages
.
get
(
"err.user_pwd_err"
));
...
...
src/main/java/com/egolm/film/api/service/impl/UserTokenServiceImpl.java
View file @
1aac2c7d
...
@@ -53,6 +53,7 @@ public class UserTokenServiceImpl implements UserTokenService {
...
@@ -53,6 +53,7 @@ public class UserTokenServiceImpl implements UserTokenService {
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
jdbcTemplate
.
executeUpdate
(
sql
,
cookie
.
getValue
(),
loginIp
,
System
.
currentTimeMillis
()/
1000
,
uid
);
jdbcTemplate
.
executeUpdate
(
sql
,
cookie
.
getValue
(),
loginIp
,
System
.
currentTimeMillis
()/
1000
,
uid
);
}
}
logger
.
debug
(
"user login success: "
+
username
);
return
token
;
return
token
;
}
else
{
}
else
{
throw
new
XException
(
messages
.
get
(
"err.user_pwd_err"
));
throw
new
XException
(
messages
.
get
(
"err.user_pwd_err"
));
...
...
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