diff --git a/README.md b/README.md index 0bf7435..774eca2 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,16 @@ 该操作用时很长,请设置最大值86400 宝塔设置教程 https://www.kancloud.cn/loveouu/bthelp/1541867 +2、nginx 404 Not Found 伪静态设置 +location ~* (runtime|application)/{ + return 403; +} +location / { + if (!-e $request_filename){ + rewrite ^(.*)$ /index.php?s=$1 last; break; + } +} + ## 后台管理截图 1、一键转存他人链接:就是将别人的分享链接转为你自己的 diff --git a/app/api/controller/Other.php b/app/api/controller/Other.php new file mode 100644 index 0000000..de44cfa --- /dev/null +++ b/app/api/controller/Other.php @@ -0,0 +1,127 @@ +url = "https://pan.xinyuedh.com"; + $this->model = new SourceModel(); + } + + /** + * 全网搜索 该接口仅用于微信自动回复 + * + * @return void + */ + public function search() + { + + $param = input(''); + if (empty($param['title'])) { + return jerr("请输入要看的内容"); + } + + $searchData = array( + 'cookie' => Config('qfshop.quark_cookie'), + 'title' => $param['title'], + ); + $res = curlHelper($this->url."/api/open/network_search", "POST", $searchData)['body']; + $res = json_decode($res, true); + + if($res['code'] !== 200){ + return jerr($res['message']); + } + + $urls = $res['data']; + + $datas = []; + foreach ($urls as $url) { + $substring = strstr($url, 's/'); + if ($substring !== false) { + $pwd_id = substr($substring, 2); // 去除 's/' 部分 + } else { + continue; + } + + $urlData = array( + 'cookie' => Config('qfshop.quark_cookie'), + 'url' => $url, + ); + $res = curlHelper($this->url."/api/open/transfer", "POST", $urlData)['body']; + $res = json_decode($res, true); + + if($res['code'] !== 200){ + continue; + } + $patterns = '/^\d+\./'; + $title = preg_replace($patterns, '', $res['data']['title']); + //添加资源到系统中 + $data["title"] = $title.'('.$param['title'].')'; + $data["url"] = $res['data']['share_url']; + $data["fid"] = $res['data']['first_file']['fid']; + $data["is_time"] = 1; + $data["update_time"] = time(); + $data["create_time"] = time(); + $this->model->insertGetId($data); + $datas[] = $data; + } + + return jok('临时资源获取成功',$datas); + } + + + /** + * 十分钟后清除临时资源 + * + * @return void + */ + public function delete_search() + { + // 搜索条件 + $map[] = ['is_time', '=', 1]; + $map[] = ['create_time', '<=', time() - (10 * 60)]; + + + $this->model->where($map)->chunk(100, function ($order) { + foreach ($order as $value) { + $deles = $value->toArray(); + $filelist = []; + $filelist[] = $deles['fid']; + + + $urlData = '{ "action_type": 2, "exclude_fids": [], "filelist": '.json_encode($filelist).' }'; + $urlHeader = array( + 'Accept: application/json, text/plain, */*', + 'Accept-Language: zh-CN,zh;q=0.9', + 'content-type: application/json;charset=UTF-8', + 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"', + 'sec-ch-ua-mobile: ?0', + 'sec-ch-ua-platform: "Windows"', + 'sec-fetch-dest: empty', + 'sec-fetch-mode: cors', + 'sec-fetch-site: same-site', + 'Referer: https://pan.quark.cn/', + 'Referrer-Policy: strict-origin-when-cross-origin', + 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', + 'cookie: '.Config('qfshop.quark_cookie'), + ); + $res = curlHelper("https://drive-pc.quark.cn/1/clouddrive/file/delete?pr=ucpro&fr=pc&uc_param_str=", "POST", $urlData, $urlHeader)['body']; + $res = json_decode($res, true); + if($res['status'] == 200){ + $this->model->where('source_id', $deles['source_id'])->delete(); + } + } + }); + + return jok('临时资源删除成功'); + } + +} diff --git a/app/index/view/index/index.html b/app/index/view/index/index.html index cc9ca71..3b5ccde 100644 --- a/app/index/view/index/index.html +++ b/app/index/view/index/index.html @@ -1,27 +1,19 @@ - - + + + + Document + + +

前端请自行前往uniapp市场打包上传

- - - 心悦搜剧 - - - - - - - - - -
- - - + https://ext.dcloud.net.cn/plugin?id=17278 + +

打包后

+ +

index.html上传至文件夹/app/index/view/index

+ +

assets上传至文件夹/public

+ + \ No newline at end of file diff --git a/app/model/Source.php b/app/model/Source.php index 81b1346..995b755 100644 --- a/app/model/Source.php +++ b/app/model/Source.php @@ -73,6 +73,7 @@ class Source extends QfShop empty($data['title']) ?: $map[] = ['title', 'like', '%' . $data['title'] . '%']; $map[] = ['status', '=', 1]; + $map[] = ['is_time', '=', 0]; if(!empty($data['day']) && $data['day']==2){ // 获取今天的时间戳范围 @@ -85,6 +86,10 @@ class Source extends QfShop $map[] = ['create_time', 'between', [$yesterdayStart, $todayEnd]]; } + if(!empty($data['is_time']) && $data['is_time']==1){ + unset($map[array_search(['is_time', '=', 0], $map)]); + } + $result['total_result'] = $this->where($map)->count(); if ($result['total_result'] <= 0) { return $result; @@ -96,7 +101,7 @@ class Source extends QfShop } $result['items'] = $this->setDefaultOrder($order) - ->field('source_id as id,title,url,update_time as time') + ->field('source_id as id,title,url,update_time as time,is_time') ->where($map) ->withSearch(['page', 'order'], $data) ->select()->each(function($item,$key){ @@ -122,6 +127,7 @@ class Source extends QfShop $map = []; $map[] = ['status', '=', 1]; + $map[] = ['is_time', '=', 0]; $result['total_result'] = $this->where($map)->count(); if ($result['total_result'] <= 0) { @@ -155,6 +161,7 @@ class Source extends QfShop $map = []; $map[] = ['status', '=', 1]; + $map[] = ['is_time', '=', 0]; $result['total_result'] = $this->where($map)->count(); if ($result['total_result'] <= 0) { diff --git a/public/nginx.htaccess b/public/nginx.htaccess index 250ba18..89c0c28 100644 --- a/public/nginx.htaccess +++ b/public/nginx.htaccess @@ -1,8 +1,8 @@ location ~* (runtime|application)/{ - return 403; + return 403; } location / { - if (!-e $request_filename){ - rewrite ^(.*)$ /index.php?s=$1 last; break; - } + if (!-e $request_filename){ + rewrite ^(.*)$ /index.php?s=$1 last; break; + } } \ No newline at end of file