Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
97262a2a
Commit
97262a2a
authored
Feb 07, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台登录改版
parent
56e0021e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
Login.php
application/index/controller/Login.php
+22
-8
No files found.
application/index/controller/Login.php
View file @
97262a2a
...
@@ -32,17 +32,20 @@ class Login extends Basic
...
@@ -32,17 +32,20 @@ class Login extends Basic
}
}
/**
/**
* @return \think\
response\View
* @return \think\
Response
* @throws \think\Exception
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
loginVerify
()
public
function
loginVerify
()
{
{
$name
=
$
_POST
[
"username"
]
;
$name
=
$
this
->
request
->
param
(
"username"
)
;
$password
=
$
_POST
[
"passwd"
]
;
$password
=
$
this
->
request
->
param
(
"passwd"
)
;
if
(
!
isset
(
$name
)
||
!
isset
(
$password
))
{
if
(
!
isset
(
$name
)
||
!
isset
(
$password
))
{
return
view
(
"/login/login"
,
[
"msg"
=>
"用户名或密码不能为空"
]
);
return
$this
->
response
(
'100'
,
'用户名或密码不能为空'
);
}
}
...
@@ -59,14 +62,16 @@ class Login extends Basic
...
@@ -59,14 +62,16 @@ class Login extends Basic
$list
=
$this
->
loginAgent
->
verifyUser
(
$filed
,
$join
,
$where
);
$list
=
$this
->
loginAgent
->
verifyUser
(
$filed
,
$join
,
$where
);
// prt($list->toArray());//转化arr
// prt($list->toArray());//转化arr
if
(
!
$list
){
if
(
!
$list
){
return
view
(
"/login/login"
,
[
"msg"
=>
"用户名或密码错误"
]
);
return
$this
->
response
(
'101'
,
'用户名或密码错误'
);
}
}
if
(
$list
[
'g_status'
]
==
'1'
){
if
(
$list
[
'g_status'
]
==
'1'
){
return
view
(
"/login/login"
,
[
"msg"
=>
"用户所在角色组已冻结"
]);
return
$this
->
response
(
'102'
,
'用户所在角色组已冻结'
);
}
}
if
(
$list
[
'admin_off'
]
!=
'0'
||
empty
(
$list
[
'rules'
])){
if
(
$list
[
'admin_off'
]
!=
'0'
||
empty
(
$list
[
'rules'
])){
return
view
(
"/login/login"
,
[
"msg"
=>
"用户无后台访问权限"
]);
return
$this
->
response
(
'103'
,
'用户无后台访问权限'
);
}
else
{
}
else
{
$rules
=
trim
(
$list
[
'rules'
],
','
);
$rules
=
trim
(
$list
[
'rules'
],
','
);
//查询后台菜单
//查询后台菜单
...
@@ -80,6 +85,10 @@ class Login extends Basic
...
@@ -80,6 +85,10 @@ class Login extends Basic
}
}
$nav2
[
$v
->
id
]
=
$v
;
$nav2
[
$v
->
id
]
=
$v
;
}
}
if
(
!
$url
){
return
$this
->
response
(
'104'
,
'用户无任何后台访模块问权限!'
);
}
//搜索菜单功能
//搜索菜单功能
$where
=
"id in(
{
$rules
}
) and is_menu=0 and status=0 "
;
$where
=
"id in(
{
$rules
}
) and is_menu=0 and status=0 "
;
...
@@ -111,8 +120,13 @@ class Login extends Basic
...
@@ -111,8 +120,13 @@ class Login extends Basic
Session
::
set
(
"lastLoginTime"
,
time
());
Session
::
set
(
"lastLoginTime"
,
time
());
$this
->
operating_records
(
$list
[
"id"
],
1
,
'后台登陆'
);
//记录操作日志
$this
->
operating_records
(
$list
[
"id"
],
1
,
'后台登陆'
);
//记录操作日志
$data
[
'url'
]
=
$url
;
$data
[
'data'
]
=
$list2
;
if
(
$this
->
request
->
isAjax
())
{
return
$this
->
response
(
'200'
,
'登录成功'
,
$data
);
}
else
{
$this
->
redirect
(
'/admin.php/'
.
$url
);
$this
->
redirect
(
'/admin.php/'
.
$url
);
}
// }
// }
...
...
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