更新666

This commit is contained in:
Alone
2024-11-04 11:35:32 +08:00
parent 16fd7106d6
commit 3777395105
17 changed files with 976 additions and 117 deletions
+35
View File
@@ -3,6 +3,8 @@
namespace app\api\controller;
use think\App;
use think\facade\Request;
use think\facade\Cache;
use app\api\QfShop;
use app\model\User as Usermodel;
use app\model\Ads as Adsmodel;
@@ -147,4 +149,37 @@ class Tool extends QfShop
}
/**
* 网页端全网搜接口
*
* @return void
*/
public function Qsearch()
{
$title = input('title');
$list = [];
if (empty($title)) {
return jok('临时资源获取成功', $list);
}
$keys = Request::ip()."_".$title;
if(Cache::get($keys) == 1){
return jerr('调用太过频繁啦');
}
Cache::set($keys, 1, 10);
$urlData = array(
'title' => $title,
);
$res = curlHelper(Request::domain()."/api/other/all_search", "POST", $urlData)['body'];
$res = json_decode($res, true);
if($res['code'] === 200){
$list = $res['data']??[];
}
Cache::delete($keys);
return jok('临时资源获取成功', $list);
}
}