Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
yunxin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3e446127
authored
May 17, 2019
by
PRY5YKGJ82EZEPX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新添加联营上传物料
parent
3301e67e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
app/Http/Middleware/CheckLogin.php
app/Model/SupplierAccountModel.php
app/Http/Middleware/CheckLogin.php
View file @
3e446127
...
...
@@ -32,12 +32,14 @@ class CheckLogin
return
redirect
(
'/web/login'
);
}
}
else
{
Redis
::
expire
(
'yunxin_login_'
.
$yunxin_token
,
7200
);
//延长登录时间
$userInfoArr
=
json_decode
(
$userInfo
,
true
);
if
(
strpos
(
$nowUrl
,
'/web/login'
)
!==
false
){
//如果已经登录,跳到登录页
return
$userInfoArr
[
'supplier_id'
]
>
0
?
redirect
(
'/web/GoodsList'
)
:
redirect
(
'/web/GoodsComList'
);
}
foreach
(
$userInfoKey
as
$k
=>
$v
){
Redis
::
expire
(
$v
,
7200
);
//延长登录时间
}
$request
->
mobile
=
$userInfoArr
[
'mobile'
];
$request
->
account_id
=
$userInfoArr
[
'account_id'
];
//自营id
$request
->
supplier_id
=
$userInfoArr
[
'supplier_id'
];
...
...
app/Model/SupplierAccountModel.php
View file @
3e446127
...
...
@@ -74,7 +74,7 @@ class SupplierAccountModel extends Model
#登录信息写入缓存
$key
=
md5
(
$account_name
.
$code
.
time
());
$expire
=
7200
;
//过期两个小时
$res
=
Redis
::
setex
(
'yunxin_login_'
.
$key
.
"_
$account_id
"
,
$expire
,
utf8JsonEncode
(
$info
));
$res
=
Redis
::
setex
(
'yunxin_login_'
.
$key
.
"_
supplier_accountid_"
.
$account_id
,
$expire
,
utf8JsonEncode
(
$info
));
if
(
$res
!=
'OK'
){
throw
new
Exception
(
'写入缓存失败'
,
1004
);
}
...
...
@@ -149,7 +149,10 @@ class SupplierAccountModel extends Model
$password
=
createPassword
(
$new_password
);
$this
->
where
(
"id"
,
$request
->
account_id
)
->
update
([
'password'
=>
$password
]);
Redis
::
del
(
"yunxin_login_"
.
$request
->
yunxin_token
.
"*"
);
//删除缓存
$userInfoKey
=
Redis
::
keys
(
'yunxin_login_'
.
$request
->
yunxin_token
.
"*"
);
foreach
(
$userInfoKey
as
$k
=>
$v
){
Redis
::
del
(
$v
);
//删除登录信息
}
return
[
0
,
"成功,请登录"
];
}
/*
...
...
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