mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
【程序目录】优化用户注销
This commit is contained in:
parent
f840df99ba
commit
3b4c485ae4
@ -68,7 +68,7 @@ class UserAuthServices extends BaseServices
|
||||
throw new AuthException('登录已过期,请重新登录', 410001);
|
||||
}
|
||||
|
||||
$user = $this->dao->get($id);
|
||||
$user = $this->dao->get(['uid' => $id, 'is_del' => 0]);
|
||||
|
||||
if (!$user || $user->uid != $tokenData['uid']) {
|
||||
if (!request()->isCli()) CacheService::clearToken($md5Token);
|
||||
|
||||
@ -27,19 +27,12 @@ class UserCancelServices extends BaseServices
|
||||
*/
|
||||
public function SetUserCancel($uid)
|
||||
{
|
||||
// $data = [];
|
||||
// $data['uid'] = $userInfo['uid'];
|
||||
// $data['name'] = $userInfo['nickname'];
|
||||
// $data['phone'] = $userInfo['phone'];
|
||||
// $data['add_time'] = time();
|
||||
// return $this->dao->save($data);
|
||||
/** @var UserServices $userServices */
|
||||
$userServices = app()->make(UserServices::class);
|
||||
/** @var WechatUserServices $wechatUserServices */
|
||||
$wechatUserServices = app()->make(WechatUserServices::class);
|
||||
$userServices->update($uid, ['is_del' => 1]);
|
||||
$wechatUserServices->update(['uid' => $uid], ['is_del' => 1]);
|
||||
CacheService::clearTokenAll('api' . $uid);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,4 +63,4 @@ class UserCancelServices extends BaseServices
|
||||
{
|
||||
return $this->dao->update($id, ['remark' => $mark]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user