ResetLogin.php 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Module\AppGame\AdminControllers\Actions;
  3. use App\Module\AppGame\SessionApp;
  4. use UCore\DcatAdmin\RowAction;
  5. use UCore\DcatAdmin\RowAction2;
  6. use Illuminate\Http\Request;
  7. use UCore\DcatAdmin\RowActionHandler;
  8. /**
  9. * 取消登陆
  10. * 重置登陆
  11. */
  12. class ResetLogin extends RowActionHandler
  13. {
  14. protected $title ='取消登陆';
  15. /**
  16. * 处理请求
  17. *
  18. * @param Request $request
  19. *
  20. * @return \Dcat\Admin\Actions\Response
  21. */
  22. public function handle(Request $request)
  23. {
  24. // 获取当前行ID
  25. $user_id = $this->getKey();
  26. SessionApp::deleteUAll($user_id);
  27. return $this->response()->success("删除用户登陆成功: [{$user_id}]")->refresh();
  28. }
  29. public function confirm()
  30. {
  31. return [
  32. // 确认弹窗 title
  33. "您确定要取消这个用户的登陆么?",
  34. // 确认弹窗 content
  35. $this->row->username,
  36. ];
  37. }
  38. }