This commit is contained in:
Alone
2024-04-26 08:50:11 +08:00
parent b1285db2ae
commit 58ec3ada76
5 changed files with 165 additions and 29 deletions
+10
View File
@@ -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、一键转存他人链接:就是将别人的分享链接转为你自己的
+127
View File
@@ -0,0 +1,127 @@
<?php
namespace app\api\controller;
use think\App;
use app\api\QfShop;
use app\model\Source as SourceModel;
class Other extends QfShop
{
public function __construct(App $app)
{
parent::__construct($app);
//第三方转存接口地址
$this->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('临时资源删除成功');
}
}
+11 -19
View File
@@ -1,27 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/assets/uni.25c1f62c.css">
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title>心悦搜剧</title>
<link rel="icon" href="/assets/logo-d44b058e.png" />
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"3HsdT1GaTQzE091Y",ck:"3HsdT1GaTQzE091Y",hashMode:true})</script>
<!--preload-links-->
<!--app-context-->
<script type="module" crossorigin src="/assets/index-403326e2.js"></script>
<link rel="stylesheet" href="/assets/index-9d2187b8.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app"><!--app-html--></div>
<p>前端请自行前往uniapp市场打包上传</p>
<a href="https://ext.dcloud.net.cn/plugin?id=17278" target="_blank">https://ext.dcloud.net.cn/plugin?id=17278</a>
<p>打包后</p>
<p>index.html上传至文件夹/app/index/view/index</p>
<p>assets上传至文件夹/public</p>
</body>
</html>
+8 -1
View File
@@ -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) {