实现微信扫码登陆

This commit is contained in:
云泽网
2025-06-06 22:36:53 +08:00
parent 25b765517a
commit 6f30eedf4a
3 changed files with 225 additions and 145 deletions
+2 -2
View File
@@ -70,10 +70,10 @@ abstract class BaseController
$userInfo = [];
if (session('user_id')) {
// 从数据库获取最新用户信息
$user = Users::where('id', session('user_id'))->find();
$user = Users::where('uid', session('user_id'))->find();
if ($user) {
$userInfo = [
'id' => $user->id,
'id' => $user->uid,
'name' => $user->name,
'account' => $user->account,
'avatar' => $user->avatar ?? '/static/images/avatar.png',