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
40859902
Commit
40859902
authored
Mar 08, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码调整
parent
655657b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
45 deletions
+33
-45
Basic.php
application/index/extend/Basic.php
+28
-42
navigation.html
application/index/view/global/navigation.html
+3
-3
public.css
public/resource/css/public.css
+2
-0
No files found.
application/index/extend/Basic.php
View file @
40859902
...
...
@@ -14,15 +14,14 @@ use app\model\GOperatingRecords;
use
think\Controller
;
use
think\Request
;
use
think\Response
;
use
think\Route
;
use
think\Session
;
use
think\Db
;
use
app\model\AuthRule
;
class
Basic
extends
Controller
{
/**
* 访问请求对象
*
* @var Request
*/
public
$request
;
...
...
@@ -33,7 +32,6 @@ class Basic extends Controller
public
$userId
;
public
$lastLoginTime
;
protected
$filterVerify
=
array
(
...
...
@@ -57,62 +55,51 @@ class Basic extends Controller
}
elseif
(
strtoupper
(
$this
->
request
->
method
())
===
"POST"
)
{
$this
->
params
=
$this
->
request
->
param
()
!=
null
?
$this
->
request
->
param
()
:
null
;
}
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
$this
->
userVerify
();
}
// $this->userAuth($requestPath);
// $this->userAuth($requestPath);
$this
->
userAuth
(
$requestPath
);
}
/**
* 权限判定
*
* @param $requestPath
* @return Response
*/
public
function
userAuth
(
$requestPath
){
$session
=
Session
::
get
(
"userinfo.nav"
);
$r
=
0
;
//判断当前控制器用户是否拥有进入权限
foreach
(
$session
as
$v
){
$session
=
Session
::
get
(
"userinfo.nav"
);
$rule
=
0
;
//判断当前控制器用户是否拥有进入权限
foreach
(
$session
as
$v
){
//不区分大小写
if
(
strcasecmp
(
trim
(
$v
[
'name'
]),
$requestPath
)
==
0
){
$r
=
$v
;
$rule
=
$v
;
}
}
if
(
$r
==
'0'
){
}
if
(
$rule
==
'0'
){
if
(
$this
->
request
->
isAjax
()){
return
$this
->
response
(
'300'
,
'没有权限'
);
return
$this
->
response
(
'300'
,
'没有权限'
);
}
else
{
// $this->error('没有当前页面权限');
}
}
else
{
Session
::
set
(
"userRule"
,
$r
);
}
//print_r($r);
}
else
{
Session
::
set
(
"userRule"
,
$rule
);
}
return
;
}
/**
* 验证登录时效
*/
public
function
userVerify
(){
$this
->
userName
=
Session
::
get
(
"userName"
);
$this
->
userId
=
Session
::
get
(
"userId"
);
$this
->
userId
=
Session
::
get
(
"userId"
);
$this
->
lastLoginTime
=
Session
::
get
(
"lastLoginTime"
);
if
(
empty
(
$this
->
userName
)
||
empty
(
$this
->
userId
)
||
empty
(
$this
->
lastLoginTime
)
){
$this
->
redirect
(
'/index/login'
);
...
...
@@ -125,6 +112,7 @@ class Basic extends Controller
/**
* 输出返回数据
*
* @param string $msg 提示消息内容
* @param string $code 业务状态码
* @param mixed $data 要返回的数据
...
...
@@ -143,7 +131,6 @@ class Basic extends Controller
return
$this
->
response
(
200
,
''
,
$data
);
}
/**
* Cors Options 授权处理
*/
...
...
@@ -177,11 +164,13 @@ class Basic extends Controller
'Access-Defined-X-Servers'
=>
'Guangzhou Cuci Technology Co. Ltd'
,
];
}
/**
/**
* 设置一条或者多条数据的状态
* @param $script 严格模式要求处理的纪录的uid等于当前登陆用户UID
*
* 严格模式要求处理的纪录的uid等于当前登陆用户UID
* @param $model
* @param bool $script
*/
public
function
setStatus
(
$model
=
CONTROLLER_NAME
,
$script
=
false
)
{
$ids
=
$this
->
request
->
param
(
'ids/a'
);
...
...
@@ -257,7 +246,6 @@ class Basic extends Controller
action_log
(
0
,
is_login
(),
[
'param'
=>
$this
->
param
],
'删除操作'
);
$result
=
model
(
$model
)
->
where
(
$map
)
->
delete
();
if
(
$result
)
{
$this
->
success
(
'删除成功,不可恢复!'
);
}
else
{
$this
->
error
(
'删除失败'
);
...
...
@@ -282,7 +270,4 @@ class Basic extends Controller
$result
=
$records
->
record
(
$agents_id
,
$type
,
$remark
);
return
$result
;
}
}
}
\ No newline at end of file
application/index/view/global/navigation.html
View file @
40859902
...
...
@@ -40,6 +40,9 @@
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/auth.html"
>
角色管理
</a>
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/authRuleIndex.html"
>
权限管理
</a>
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/agent.html"
>
经纪人列表
</a>
</li>
...
...
@@ -52,9 +55,6 @@
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/remarkFollowIndex.html"
>
跟进列表
</a>
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/authRuleIndex.html"
>
权限管理
</a>
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/houseList.html"
>
商铺列表
</a>
</li>
...
...
public/resource/css/public.css
View file @
40859902
...
...
@@ -38,6 +38,8 @@ a:hover{
}
.dropdown
{
float
:
right
;
margin-top
:
8px
;
margin-right
:
2px
;
}
.dropdown-menu
{
min-width
:
72px
;
...
...
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