Explorar o código

fix(user): 添加参数验证防止空类型查询

- 在xfb_list方法中添加type参数必填验证
- 当type参数为空时返回参数错误提示
- 避免因缺少必要参数导致的潜在查询异常
shichen hai 3 meses
pai
achega
645c5465a4
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      app/controller/api/user/User.php

+ 3 - 0
app/controller/api/user/User.php

@@ -628,6 +628,9 @@ class User extends BaseController
628 628
     public function xfb_list()
629 629
     {
630 630
         $type = $this->request->param('type');
631
+        if (!$type) {
632
+            return app('json')->fail('参数错误');
633
+        }
631 634
         [$page, $limit] = $this->getPage();
632 635
         $uid = $this->request->uid();
633 636
         $where['uid'] = $uid;