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
8441b28d
Commit
8441b28d
authored
Nov 20, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台登陆
parent
83623800
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
AdminTokenServiceImpl.java
...lm/film/api/admin/service/impl/AdminTokenServiceImpl.java
+7
-7
No files found.
src/main/java/com/egolm/film/api/admin/service/impl/AdminTokenServiceImpl.java
View file @
8441b28d
package
com
.
egolm
.
film
.
api
.
admin
.
service
.
impl
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.Cookie
;
import
javax.servlet.http.HttpSession
;
...
...
@@ -11,6 +10,7 @@ import org.springframework.stereotype.Service;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.film.api.admin.service.AdminTokenService
;
import
com.egolm.film.bean.Fc_admin
;
import
com.egolm.film.config.WebMvcConfig
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.model.LoginToken
;
...
...
@@ -26,17 +26,17 @@ public class AdminTokenServiceImpl implements AdminTokenService {
public
LoginToken
doLogin
(
String
username
,
String
password
)
{
HttpSession
session
=
WebMvcConfig
.
getSession
();
String
loginSql
=
"select * from fc_admin where username = ?"
;
List
<
Map
<
String
,
Object
>>
list
=
this
.
jdbcTemplate
.
queryForList
(
loginSql
,
username
);
List
<
Fc_admin
>
list
=
this
.
jdbcTemplate
.
queryForBeans
(
loginSql
,
Fc_admin
.
class
,
username
);
if
(
list
!=
null
)
{
if
(
list
.
size
()
==
1
)
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
Integer
state
=
(
Integer
)
map
.
get
(
"state"
);
String
salt
=
(
String
)
map
.
get
(
"salt"
);
String
pwd
=
(
String
)
map
.
get
(
"password"
);
Fc_admin
admin
=
list
.
get
(
0
);
Integer
state
=
admin
.
getState
(
);
String
salt
=
admin
.
getSalt
(
);
String
pwd
=
admin
.
getPassword
(
);
String
encodePassword
=
Common
.
encodePassword
(
password
,
salt
);
if
(
encodePassword
.
equals
(
pwd
))
{
if
(
state
==
1
)
{
Integer
adminid
=
(
Integer
)
map
.
get
(
"adminid"
);
Integer
adminid
=
admin
.
getAdminid
(
);
LoginToken
token
=
new
LoginToken
(
adminid
);
session
.
setAttribute
(
TOKEN_NAME
,
token
);
Cookie
cookie
=
WebMvcConfig
.
getCookie
(
JSESSIONID
);
...
...
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