|
|
@ -3,6 +3,7 @@ |
|
|
namespace app\model; |
|
|
namespace app\model; |
|
|
|
|
|
|
|
|
use think\facade\Cache; |
|
|
use think\facade\Cache; |
|
|
|
|
|
use think\facade\Session; |
|
|
use think\Model; |
|
|
use think\Model; |
|
|
use think\model\concern\SoftDelete; |
|
|
use think\model\concern\SoftDelete; |
|
|
|
|
|
|
|
|
@ -67,7 +68,7 @@ class User extends Model |
|
|
# 缓存用户信息 |
|
|
# 缓存用户信息 |
|
|
$login_user_data = $user->toArray(); |
|
|
$login_user_data = $user->toArray(); |
|
|
unset($login_user_data['password'],$login_user_data['salt']); |
|
|
unset($login_user_data['password'],$login_user_data['salt']); |
|
|
#Session::set('login_user_data',$login_user_data); |
|
|
Session::set('login_user_data',$login_user_data); |
|
|
Cache::store('redis')->set('login_user_data',serialize($login_user_data),7200); |
|
|
Cache::store('redis')->set('login_user_data',serialize($login_user_data),7200); |
|
|
// 登陆成功 |
|
|
// 登陆成功 |
|
|
return ['status' => true, 'msg' => '登陆成功', 'data' => $login_user_data]; |
|
|
return ['status' => true, 'msg' => '登陆成功', 'data' => $login_user_data]; |
|
|
|