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 info()
  39. {
  40. }
  41. /**
  42. * 保存新建的资源
  43. *
  44. * @param \think\Request $request
  45. * @return \think\Response
  46. */
  47. public function save(Request $request)
  48. {
  49. //
  50. }
  51. /**
  52. * 显示指定的资源
  53. *
  54. * @param int $id
  55. * @return \think\Response
  56. */
  57. public function read($id)
  58. {
  59. //
  60. }
  61. /**
  62. * 显示编辑资源表单页.
  63. *
  64. * @param int $id
  65. * @return \think\Response
  66. */
  67. public function edit($id)
  68. {
  69. //
  70. }
  71. /**
  72. * 保存更新的资源
  73. *
  74. * @param \think\Request $request
  75. * @param int $id
  76. * @return \think\Response
  77. */
  78. public function update(Request $request, $id)
  79. {
  80. //
  81. }
  82. /**
  83. * 删除指定资源
  84. *
  85. * @param int $id
  86. * @return \think\Response
  87. */
  88. public function delete($id)
  89. {
  90. //
  91. }
  92. }