Explorar el Código

修改b端接口:验证路由的接口(路由白名单-全局路由);

15313670163 hace 3 días
padre
commit
eb282ad635
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      app/JsonRpc/NewsService.php

+ 5 - 1
app/JsonRpc/NewsService.php

@@ -2687,8 +2687,12 @@ private function fetchArticles($catId, $website, $limit, $isImageArticle = false
     }
     if (isset($data['other_route']) && !empty($data['other_route'])) {
       $whiteRouterInfo = WhiteRouter::whereJsonContains("website_id", $data['website_id'])->where('router_url', $data['other_route'])->first();
+      // 验证路由是否存在
+      if (empty($whiteRouterInfo)) {
+            $whiteRouterInfo = WhiteRouter::where("router_type", 1)->where('router_url', $data['other_route'])->first();
+      }
       if (!empty($whiteRouterInfo)) {
-        return Result::success($whiteRouterInfo->toArray());
+            return Result::success($whiteRouterInfo->toArray());
       }
     }
     // 验证栏目路由