mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-26 12:38:13 +00:00
fix(observer): 修复 UserObserver 调用 private 方法 authInfo() 的错误
将 User::authInfo() 改为 User::userid(),因为 authInfo() 是 private 方法, Observer 无法访问。userid() 是 public 方法,内部会正确调用 authInfo()。 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
parent
f68f759418
commit
2cdde37069
@ -99,8 +99,8 @@ class UserObserver extends AbstractObserver
|
||||
|
||||
if (!empty($changedFields)) {
|
||||
// 判断是用户自己修改还是管理员修改
|
||||
$currentUser = User::authInfo();
|
||||
$eventType = ($currentUser && $currentUser->userid === $user->userid)
|
||||
$currentUserid = User::userid();
|
||||
$eventType = ($currentUserid > 0 && $currentUserid === $user->userid)
|
||||
? 'profile_update'
|
||||
: 'admin_update';
|
||||
Apps::dispatchUserHook($user, 'user_update', $eventType, $changedFields);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user