网站配置

This commit is contained in:
taoser 2020-12-09 14:17:52 +08:00
parent 24c4d52e4d
commit 6534827c4e
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ namespace app\middleware;
use think\facade\Session; use think\facade\Session;
use think\facade\Cookie; use think\facade\Cookie;
use think\facade\Db; use think\facade\Db;
use think\facade\Config;
class LoginCookie class LoginCookie
{ {
@ -18,7 +19,7 @@ class LoginCookie
$user = Db::name('user')->where('id',$userId)->find(); $user = Db::name('user')->where('id',$userId)->find();
if($user){ if($user){
//验证cookie //验证cookie
$salt = 'taoler'; $salt = Config::get('taoler.salt');
$auth = md5($user['name'].$salt).":".$userId; $auth = md5($user['name'].$salt).":".$userId;
if($auth==$cooAuth){ if($auth==$cooAuth){
Session::set('user_name',$user['name']); Session::set('user_name',$user['name']);

View File

@ -5,6 +5,6 @@
return [ return [
//版本配置 //版本配置
'version' => '1.6.3', 'version' => '1.6.4',
'salt' => 'taoler' 'salt' => 'taoler'
]; ];