User.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\Admin\controller;
  4. use app\BaseController;
  5. use think\Request;
  6. class User extends BaseController
  7. {
  8. /**
  9. * 显示资源列表
  10. *
  11. * @return \think\Response
  12. */
  13. public function list()
  14. {
  15. $post =$this->request->post();
  16. $token = isset($post['token']) ? trim($post['token']) : "";
  17. if($token==""){
  18. return error_show(101,'token不能为空');
  19. }
  20. $effetc =VerifyTokens($token);
  21. if(!empty($effetc) && $effetc['code']!=0){
  22. return error_show($effetc['code'],$effetc['message']);
  23. }
  24. $page = isset($post['page'])&& $post['page']!='' ? intval($post['page']) : 1;
  25. $size = isset($post['size'])&& $post['size']!='' ? intval($post['size']) : 10;
  26. $condition = ['page'=>$page,'size'=>$size];
  27. $data = GetUserlist($token,$condition);
  28. if(!empty($data) && $data['code']!=0){
  29. return error_show($effetc['code'],$effetc['message']);
  30. }
  31. return app_show($data['code'],$data['message'],$data['data']);
  32. }
  33. /**
  34. * 显示创建资源表单页.
  35. *
  36. * @return \think\Response
  37. */
  38. public function create()
  39. {
  40. //
  41. }
  42. /**
  43. * 保存新建的资源
  44. *
  45. * @param \think\Request $request
  46. * @return \think\Response
  47. */
  48. public function save(Request $request)
  49. {
  50. //
  51. }
  52. /**
  53. * 显示指定的资源
  54. *
  55. * @param int $id
  56. * @return \think\Response
  57. */
  58. public function read($id)
  59. {
  60. //
  61. }
  62. /**
  63. * 显示编辑资源表单页.
  64. *
  65. * @param int $id
  66. * @return \think\Response
  67. */
  68. public function edit($id)
  69. {
  70. //
  71. }
  72. /**
  73. * 保存更新的资源
  74. *
  75. * @param \think\Request $request
  76. * @param int $id
  77. * @return \think\Response
  78. */
  79. public function update(Request $request, $id)
  80. {
  81. //
  82. }
  83. /**
  84. * 删除指定资源
  85. *
  86. * @param int $id
  87. * @return \think\Response
  88. */
  89. public function delete($id)
  90. {
  91. //
  92. }
  93. }