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
7102c317
Commit
7102c317
authored
Apr 14, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[0]
parent
684b6e43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
RedisCacheService.php
application/api_broker/service/RedisCacheService.php
+3
-1
Login.php
application/index/controller/Login.php
+1
-4
Basic.php
application/index/extend/Basic.php
+3
-5
No files found.
application/api_broker/service/RedisCacheService.php
View file @
7102c317
...
...
@@ -217,7 +217,7 @@ class RedisCacheService
if
(
!
empty
(
$data
))
{
$this
->
setRedisCache
(
$this
->
group_key
.
$group_id
,
$data
[
0
]);
}
return
$data
;
return
$data
[
0
]
;
}
/**
...
...
@@ -342,6 +342,8 @@ class RedisCacheService
$result
=
$this
->
redis_ext
->
get
(
$this
->
group_site_key
.
$id
);
if
(
empty
(
$result
))
{
$result
=
$this
->
groupSiteCache
(
$id
);
}
else
{
$result
=
json_decode
(
$result
);
}
break
;
default
:
...
...
application/index/controller/Login.php
View file @
7102c317
...
...
@@ -46,11 +46,8 @@ class Login extends Basic
*/
public
function
login
()
{
Session
::
clear
();
$this
->
assign
(
'mac_address'
,
$this
->
params
[
'mac_address'
]
?
$this
->
params
[
'mac_address'
]
:
''
);
$expire_time
=
Session
::
get
(
"expire_time"
);
if
(
$expire_time
>
time
())
{
$this
->
redirect
(
'/admin.php/index/mainIndex'
);
}
return
view
(
"/login/login"
);
}
...
...
application/index/extend/Basic.php
View file @
7102c317
...
...
@@ -139,9 +139,6 @@ class Basic extends Controller
*
* @param $requestPath
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
userAuth
(
$requestPath
){
$session_menu
=
Session
::
get
(
"user_info.menu"
);
...
...
@@ -176,9 +173,9 @@ class Basic extends Controller
// $agents = new AAgents();
// $is_auth = $agents->agentsAuth($auth_id, $this->userId);
// $is_auth = empty($is_auth['id']) ? 0:1;
/*读缓存 start*/
$redis_cache
=
new
RedisCacheService
();
$agent_data
=
$redis_cache
->
getRedisCache
(
2
,
$this
->
userId
);
if
(
$agent_data
[
'auth_group_id'
])
{
$group_data
=
$redis_cache
->
getRedisCache
(
3
,
$agent_data
[
'auth_group_id'
]);
if
(
$group_data
[
'rules'
])
{
...
...
@@ -188,6 +185,7 @@ class Basic extends Controller
}
}
}
/*读缓存 end*/
if
(
$is_auth
==
0
)
{
//处理盘方编辑商铺
...
...
@@ -285,7 +283,7 @@ class Basic extends Controller
$expire
=
Config
::
get
(
'session.expire'
);
$expire
=
empty
(
$expire
)
?
7200
:
$expire
;
Cookie
::
set
(
'PHPSESSID'
,
session_id
(),
$expire
);
//更新session_id过期时间
Session
::
set
(
"expire_time"
,
time
()
+
$expire
-
3
00
);
//更新过期时间
Session
::
set
(
"expire_time"
,
time
()
+
$expire
-
9
00
);
//更新过期时间
}
return
;
}
...
...
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