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
7df66a69
Commit
7df66a69
authored
Dec 04, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
16ed0cd0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
8 deletions
+12
-8
MemberService.java
src/main/java/com/egolm/film/api/service/MemberService.java
+1
-1
AdminTokenServiceImpl.java
...om/egolm/film/api/service/impl/AdminTokenServiceImpl.java
+3
-2
MemberServiceImpl.java
...va/com/egolm/film/api/service/impl/MemberServiceImpl.java
+3
-3
MemberTokenServiceImpl.java
...m/egolm/film/api/service/impl/MemberTokenServiceImpl.java
+2
-1
UserTokenServiceImpl.java
...com/egolm/film/api/service/impl/UserTokenServiceImpl.java
+3
-1
No files found.
src/main/java/com/egolm/film/api/service/MemberService.java
View file @
7df66a69
...
@@ -33,7 +33,7 @@ public interface MemberService {
...
@@ -33,7 +33,7 @@ public interface MemberService {
Fc_member
getMemberByToken
(
String
token
);
Fc_member
getMemberByToken
(
String
token
);
void
update
Token
(
Integer
member_id
,
String
token_string
);
void
update
LoginInfo
(
Integer
member_id
,
String
login_ip
,
String
token_string
);
void
updateLanguage
(
Integer
id
,
String
string
);
void
updateLanguage
(
Integer
id
,
String
string
);
...
...
src/main/java/com/egolm/film/api/service/impl/AdminTokenServiceImpl.java
View file @
7df66a69
...
@@ -45,8 +45,9 @@ public class AdminTokenServiceImpl implements AdminTokenService {
...
@@ -45,8 +45,9 @@ public class AdminTokenServiceImpl implements AdminTokenService {
session
.
setAttribute
(
TOKEN_NAME
,
token
);
session
.
setAttribute
(
TOKEN_NAME
,
token
);
Cookie
cookie
=
WebMvcConfig
.
getOrCreateUUIDCookie
(
LOGINID_COOKIE_NAME
,
"/"
,
60
*
60
*
24
,
true
);
Cookie
cookie
=
WebMvcConfig
.
getOrCreateUUIDCookie
(
LOGINID_COOKIE_NAME
,
"/"
,
60
*
60
*
24
,
true
);
if
(
cookie
!=
null
)
{
if
(
cookie
!=
null
)
{
String
sql
=
"update fc_admin set token = ? where adminid = ?"
;
String
sql
=
"update fc_admin set token = ?, login_ip, login_time where adminid = ?"
;
jdbcTemplate
.
executeUpdate
(
sql
,
cookie
.
getValue
(),
adminid
);
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
jdbcTemplate
.
executeUpdate
(
sql
,
cookie
.
getValue
(),
loginIp
,
System
.
currentTimeMillis
()/
1000
,
adminid
);
}
}
return
token
;
return
token
;
}
else
if
(
state
==
2
)
{
}
else
if
(
state
==
2
)
{
...
...
src/main/java/com/egolm/film/api/service/impl/MemberServiceImpl.java
View file @
7df66a69
...
@@ -104,9 +104,9 @@ public class MemberServiceImpl implements MemberService {
...
@@ -104,9 +104,9 @@ public class MemberServiceImpl implements MemberService {
}
}
@Override
@Override
public
void
update
Token
(
Integer
member_id
,
String
token_string
)
{
public
void
update
LoginInfo
(
Integer
member_id
,
String
login_ip
,
String
token_string
)
{
String
sql
=
"update fc_member set token = ? where id = ?"
;
String
sql
=
"update fc_member set token = ?
, login_time = ?, login_ip = ?
where id = ?"
;
jdbcTemplate
.
executeUpdate
(
sql
,
token_string
,
member_id
);
jdbcTemplate
.
executeUpdate
(
sql
,
token_string
,
System
.
currentTimeMillis
()/
1000
,
login_ip
,
member_id
);
}
}
@Override
@Override
...
...
src/main/java/com/egolm/film/api/service/impl/MemberTokenServiceImpl.java
View file @
7df66a69
...
@@ -53,7 +53,8 @@ public class MemberTokenServiceImpl implements MemberTokenService {
...
@@ -53,7 +53,8 @@ public class MemberTokenServiceImpl implements MemberTokenService {
session
.
setAttribute
(
TOKEN_NAME
,
token
);
session
.
setAttribute
(
TOKEN_NAME
,
token
);
Cookie
cookie
=
WebMvcConfig
.
getOrCreateUUIDCookie
(
LOGINID_COOKIE_NAME
,
"/"
,
60
*
60
,
true
);
Cookie
cookie
=
WebMvcConfig
.
getOrCreateUUIDCookie
(
LOGINID_COOKIE_NAME
,
"/"
,
60
*
60
,
true
);
if
(
cookie
!=
null
)
{
if
(
cookie
!=
null
)
{
memberService
.
updateToken
(
id
,
cookie
.
getValue
());
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
memberService
.
updateLoginInfo
(
id
,
loginIp
,
cookie
.
getValue
());
}
}
return
token
;
return
token
;
}
else
{
}
else
{
...
...
src/main/java/com/egolm/film/api/service/impl/UserTokenServiceImpl.java
View file @
7df66a69
...
@@ -49,7 +49,9 @@ public class UserTokenServiceImpl implements UserTokenService {
...
@@ -49,7 +49,9 @@ public class UserTokenServiceImpl implements UserTokenService {
session
.
setAttribute
(
TOKEN_NAME
,
token
);
session
.
setAttribute
(
TOKEN_NAME
,
token
);
Cookie
cookie
=
WebMvcConfig
.
getOrCreateUUIDCookie
(
LOGINID_COOKIE_NAME
,
"/"
,
60
*
60
*
24
,
true
);
Cookie
cookie
=
WebMvcConfig
.
getOrCreateUUIDCookie
(
LOGINID_COOKIE_NAME
,
"/"
,
60
*
60
*
24
,
true
);
if
(
cookie
!=
null
)
{
if
(
cookie
!=
null
)
{
jdbcTemplate
.
executeUpdate
(
"update fc_user set token = ? where uid = ?"
,
cookie
.
getValue
(),
uid
);
String
sql
=
"update fc_user set token = ?, login_ip = ?, login_time = ? where uid = ?"
;
String
loginIp
=
ServletUtil
.
remoteIp
(
WebMvcConfig
.
getRequest
());
jdbcTemplate
.
executeUpdate
(
sql
,
cookie
.
getValue
(),
loginIp
,
System
.
currentTimeMillis
()/
1000
,
uid
);
}
}
return
token
;
return
token
;
}
else
{
}
else
{
...
...
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