From ca7422102b83f86a9eb71b55af3c5f7c1631ed35 Mon Sep 17 00:00:00 2001 From: Alone <675061370@qq.com> Date: Thu, 7 Nov 2024 09:39:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E8=AF=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Index.php | 2 ++ app/model/Source.php | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 3857380..4bf5766 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -92,6 +92,8 @@ class Index extends QfShop $data['page_size'] = 10; $data['title'] = $name; $data['category_id'] = $cate; + $data['search_type'] = 1; + $data['is_time'] = 1; $list = $this->SourceModel->getList($data); diff --git a/app/model/Source.php b/app/model/Source.php index c607c7c..f2f8b7e 100644 --- a/app/model/Source.php +++ b/app/model/Source.php @@ -109,7 +109,8 @@ class Source extends QfShop $ip = $_SERVER['REMOTE_ADDR']; $ips = Log::where(['ip'=>$ip])->find(); if(empty($ips)){ - Log::save(['name' => '访问记录','ip'=>$ip]); + $log = new Log(); + $log->save(['name' => '访问记录','ip'=>$ip]); }else{ Log::where('id', $ips['id'])->update(['update_time' => time()]); } @@ -133,7 +134,8 @@ class Source extends QfShop // 如果存在 title,则进行分词 if (!empty($data['title'])) { - $search_type = config('qfshop.search_type')??1; + $search_type = isset($data['search_type']) ? (config('qfshop.search_type') ?? 1) : 1; //默认除网页端其它均为模糊搜索,想开启机器人分词搜索注释该行,取消注释下一行 + // $search_type = config('qfshop.search_type') ?? 1; if($search_type == 0){ $map[] = ['title|description', 'like', '%' . trim($data['title']) . '%']; @@ -142,9 +144,13 @@ class Source extends QfShop $fc = new VicWord(); $keywords = $fc->getAutoWord($data['title']); $keywords = filterAndExtractWords($keywords); + $keywords = array_filter($keywords, function($keyword) { + return mb_strlen($keyword, 'UTF-8') > 1; + }); + $keywords = array_values($keywords); // 如果分词后有关键词 - if (count($keywords) > 1) { + if (count($keywords) >= 1) { if($search_type == 1){ //分词同时满足才搜索的到! foreach ($keywords as $keyword) { From 5d211fe39a526ce6f9ff7ba66e6bda9a9e072e77 Mon Sep 17 00:00:00 2001 From: Alone <675061370@qq.com> Date: Sat, 9 Nov 2024 11:52:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=88=AC=E8=99=AB?= =?UTF-8?q?=E5=85=A8=E7=BD=91=E6=90=9C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Tool.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/api/controller/Tool.php b/app/api/controller/Tool.php index eefa79f..71e37e9 100644 --- a/app/api/controller/Tool.php +++ b/app/api/controller/Tool.php @@ -159,6 +159,16 @@ class Tool extends QfShop $title = input('title'); $list = []; + + $userAgent = Request::header('user-agent'); + // 定义常见爬虫的 User-Agent 关键字 + $bots = ['Googlebot', 'Bingbot', 'Baiduspider']; + foreach ($bots as $bot) { + if (strpos($userAgent, $bot) !== false) { + return jerr('该接口禁止爬虫访问'); + } + } + if (empty($title)) { return jok('临时资源获取成功', $list); } From 81e4818e0f20894be73ed65efdaa254b85d0bd75 Mon Sep 17 00:00:00 2001 From: Alone <675061370@qq.com> Date: Sat, 9 Nov 2024 15:44:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E4=B8=8B=E7=AB=99?= =?UTF-8?q?=E9=95=BF=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 20 ++++++++++---------- app/qfadmin/view/source/category.html | 2 +- chat_channel.py | 6 +++--- chatgpt-on-wechat/chat_channel.py | 2 +- chatgpt-on-wechat/config.json | 2 +- extend/quarkPlugin/QuarkPlugin.php | 2 +- public/assets/pages-index-index.-O3dtvSQ.js | 2 +- public/robots.txt | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 334e144..dd8eda2 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ ## 演示 -[前端体验](https://pan.xinyuedh.com) +[前端体验](https://www.xinyueso.com) - + ## 后台安装教程 @@ -73,11 +73,11 @@ location / { ## 前台截图 -![image](https://pan.xinyuedh.com/github/p3.png) +![image](https://www.xinyueso.com/github/p3.png) -![image](https://pan.xinyuedh.com/github/p2.png) +![image](https://www.xinyueso.com/github/p2.png) -![image](https://pan.xinyuedh.com/github/p1.png) +![image](https://www.xinyueso.com/github/p1.png) ## 后台管理截图 @@ -87,18 +87,18 @@ location / { 3、每日自动更新:自动转存每天的资源并入库 -![image](https://pan.xinyuedh.com/1.png) +![image](https://www.xinyueso.com/1.png) -![image](https://pan.xinyuedh.com/2.png) +![image](https://www.xinyueso.com/2.png) -![image](https://pan.xinyuedh.com/3.png) +![image](https://www.xinyueso.com/3.png) ## 如何获取夸克网盘Cookie 登录夸克网盘后,按下F12,刷新页面 -![image](https://pan.xinyuedh.com/cookie.jpg) +![image](https://www.xinyueso.com/cookie.jpg) # 免费交流社群 @@ -107,7 +107,7 @@ location / { 请加微信l1417716300 -| | | +| | | | --- | --- | 程序使用不收费,但不负责搭建,搭建过程遇到问题,可以私聊或群里咨询 diff --git a/app/qfadmin/view/source/category.html b/app/qfadmin/view/source/category.html index 2839a2b..6343bd8 100644 --- a/app/qfadmin/view/source/category.html +++ b/app/qfadmin/view/source/category.html @@ -107,7 +107,7 @@

全部转存:一键转存心悦搜索所有资源到自己的网盘及系统中

全部转存速度比较慢,提交后请耐心等待;名称重复的资源会跳过转存;

全部转存需要按类别转存:见下方列表一键转存按钮

-

Tips:心悦搜索:https://pan.xinyuedh.com;

+

Tips:心悦搜索:https://www.xinyueso.com;

diff --git a/chat_channel.py b/chat_channel.py index cbf9b79..bc29734 100644 --- a/chat_channel.py +++ b/chat_channel.py @@ -152,7 +152,7 @@ class ChatChannel(Channel): reply_text_final += "\n⚠️宁少写,不多写、错写~" reply_text_final += "\n--------------------" reply_text_final += "\n可访问以下链接提交资源需求" - reply_text_final += "\nhttps://pan.xinyuedh.com" + reply_text_final += "\nhttps://www.xinyueso.com" # reply_text_final += "\n--------------------" # reply_text_final += "\nGPT小助手分享" # reply_text_final += "\n--------------------" @@ -517,7 +517,7 @@ def process_string2(s): def search_question(question): - url = 'https://pan.xinyuedh.com/api/search' + url = 'https://www.xinyueso.com/api/search' params = { 'is_time': '1', 'page_no': '1', @@ -534,7 +534,7 @@ def search_question(question): return [] def search_alone(question): - url = 'https://pan.xinyuedh.com/api/other/all_search' + url = 'https://www.xinyueso.com/api/other/all_search' payload = { 'title': question } diff --git a/chatgpt-on-wechat/chat_channel.py b/chatgpt-on-wechat/chat_channel.py index 993042b..1a9b7b7 100644 --- a/chatgpt-on-wechat/chat_channel.py +++ b/chatgpt-on-wechat/chat_channel.py @@ -151,7 +151,7 @@ class ChatChannel(Channel): reply_text_final += "\n⚠️宁少写,不多写、错写~" # reply_text_final += "\n--------------------" # reply_text_final += "\n可访问以下链接提交资源需求" - # reply_text_final += "\nhttps://pan.xinyuedh.com" + # reply_text_final += "\nhttps://www.xinyueso.com" # reply_text_final += "\n--------------------" # reply_text_final += "\nGPT小助手分享" # reply_text_final += "\n--------------------" diff --git a/chatgpt-on-wechat/config.json b/chatgpt-on-wechat/config.json index b9ab4a5..5f1a3e0 100644 --- a/chatgpt-on-wechat/config.json +++ b/chatgpt-on-wechat/config.json @@ -1,6 +1,6 @@ { "debug": true, - "duanju_url": "https://pan.xinyuedh.com", + "duanju_url": "https://www.xinyueso.com", "channel_type": "wx", "model": "gpt-4", "open_ai_api_key": "", diff --git a/extend/quarkPlugin/QuarkPlugin.php b/extend/quarkPlugin/QuarkPlugin.php index 8a36d03..5df93d9 100644 --- a/extend/quarkPlugin/QuarkPlugin.php +++ b/extend/quarkPlugin/QuarkPlugin.php @@ -17,7 +17,7 @@ class QuarkPlugin public function __construct() { //第三方转存接口地址 - $this->url = "https://pan.xinyuedh.com"; + $this->url = "https://www.xinyueso.com"; $this->model = new SourceModel(); $this->SourceLogModel = new SourceLogModel(); $this->source_category_id = 0; diff --git a/public/assets/pages-index-index.-O3dtvSQ.js b/public/assets/pages-index-index.-O3dtvSQ.js index adec84c..c438593 100644 --- a/public/assets/pages-index-index.-O3dtvSQ.js +++ b/public/assets/pages-index-index.-O3dtvSQ.js @@ -1 +1 @@ -import{n as e,r as a,a as t,b as s,c as l,w as o,i as c,o as i,d as n,e as d,t as r,f as u,g,h as f,j as h,k as m,l as p,F as _,m as y,p as k,I as w}from"./index-CICgbd-2.js";import{_ as C,H as b,F as x,r as B,a as v}from"./footer.GjOAft6T.js";const H=C({components:{Header:b,Footer:x},data:()=>({keyword:"",tab:0,loading:!1,hot:[],loading2:!1,newList:[],category_id:"",category:[{value:"",text:"全部"}]}),onLoad(){this.getClass(),this.getHot(),this.getNew()},computed:{config(){return this.$store.state.config}},methods:{searchBtn(){e({url:"/pages/index/list?category_id="+this.category_id+"&keyword="+encodeURIComponent(this.keyword)}),this.keyword=""},goSearch(a){e({url:"/pages/index/list?keyword="+encodeURIComponent(a)})},getHot(){this.loading=!0,a({url:"https://pan.xinyuedh.com/api/search/getHot",success:e=>{let a=[],t=[];try{t=e.data.data}catch(s){}for(let l of t)a.push({title:l.title,hot:l.hots,ranking:l.ranking});this.hot=a},complete:()=>{this.loading=!1}})},getNew(){this.loading2=!0,a({url:baseURL+"api/search/getNew",success:e=>{let a=[],t=[];try{t=e.data.data.items}catch(s){}for(let l of t)a.push({title:l.title,num:l.times});this.newList=a},complete:()=>{this.loading2=!1}})},getClass(){let e=[{value:"",text:"全部"}];a({url:baseURL+"api/search/getCategory",success:a=>{let t=a.data.data||[];for(let s of t)e.push({value:s.source_category_id,text:s.name});this.category=e}})}}},[["render",function(e,a,C,b,x,H){const L=t("Header"),U=y,V=k,F=c,I=B(s("uni-data-select"),v),R=w,S=t("Footer");return i(),l(F,{class:"view"},{default:o((()=>[n(L),n(F,{class:"homeBox"},{default:o((()=>[n(F,{class:"logoBox"},{default:o((()=>[n(U,{class:"logo",src:H.config?H.config.logo:""},null,8,["src"]),n(V,{class:"title"},{default:o((()=>[d(r(H.config?H.config.app_name:""),1)])),_:1})])),_:1}),n(F,{class:"subTitle"},{default:o((()=>[d(r(H.config?H.config.app_description:""),1)])),_:1}),n(F,{class:u(["search",x.category.length>2?"":"noSelect"])},{default:o((()=>[n(I,{class:"selectBox",modelValue:x.category_id,"onUpdate:modelValue":a[0]||(a[0]=e=>x.category_id=e),localdata:x.category,clear:!1},null,8,["modelValue","localdata"]),g("i",{class:"iconfont icon-sousuo",onClick:a[1]||(a[1]=(...e)=>H.searchBtn&&H.searchBtn(...e))}),n(R,{type:"text",modelValue:x.keyword,"onUpdate:modelValue":a[2]||(a[2]=e=>x.keyword=e),placeholder:"输入关键字进行搜索",onKeyup:f(H.searchBtn,["enter"]),"confirm-type":"search",onConfirm:H.searchBtn},null,8,["modelValue","onKeyup","onConfirm"])])),_:1},8,["class"]),n(F,{class:"content"},{default:o((()=>[n(F,{class:"tabs"},{default:o((()=>[n(F,{class:u(["item",0===x.tab?"active":""]),onClick:a[3]||(a[3]=e=>x.tab=0)},{default:o((()=>[d("热门资源")])),_:1},8,["class"]),n(F,{class:u(["item",1===x.tab?"active":""]),onClick:a[4]||(a[4]=e=>x.tab=1)},{default:o((()=>[d("最新资源")])),_:1},8,["class"])])),_:1}),0===x.tab?(i(),l(F,{key:0,class:"list"},{default:o((()=>[x.loading?(i(),l(F,{key:0,class:"loading"},{default:o((()=>[d("正在努力加载中...")])),_:1})):h("",!0),(i(!0),m(_,null,p(x.hot,((e,a)=>(i(),l(F,{class:"item",key:a,onClick:a=>H.goSearch(e.title)},{default:o((()=>[n(F,{class:"name"},{default:o((()=>[d(r(e.ranking)+"、"+r(e.title),1)])),_:2},1024),n(F,{class:"num"},{default:o((()=>[d(r(e.hot),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):h("",!0),1===x.tab?(i(),l(F,{key:1,class:"list"},{default:o((()=>[x.loading2?(i(),l(F,{key:0,class:"loading"},{default:o((()=>[d("正在努力加载中...")])),_:1})):h("",!0),(i(!0),m(_,null,p(x.newList,((e,a)=>(i(),l(F,{class:"item",key:a,onClick:a=>H.goSearch(e.title)},{default:o((()=>[n(F,{class:"name"},{default:o((()=>[d(r(a+1)+"、"+r(e.title),1)])),_:2},1024),n(F,{class:"num"},{default:o((()=>[d(r(e.num),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):h("",!0)])),_:1})])),_:1}),n(S)])),_:1})}],["__scopeId","data-v-df5dc4b2"]]);export{H as default}; +import{n as e,r as a,a as t,b as s,c as l,w as o,i as c,o as i,d as n,e as d,t as r,f as u,g,h as f,j as h,k as m,l as p,F as _,m as y,p as k,I as w}from"./index-CICgbd-2.js";import{_ as C,H as b,F as x,r as B,a as v}from"./footer.GjOAft6T.js";const H=C({components:{Header:b,Footer:x},data:()=>({keyword:"",tab:0,loading:!1,hot:[],loading2:!1,newList:[],category_id:"",category:[{value:"",text:"全部"}]}),onLoad(){this.getClass(),this.getHot(),this.getNew()},computed:{config(){return this.$store.state.config}},methods:{searchBtn(){e({url:"/pages/index/list?category_id="+this.category_id+"&keyword="+encodeURIComponent(this.keyword)}),this.keyword=""},goSearch(a){e({url:"/pages/index/list?keyword="+encodeURIComponent(a)})},getHot(){this.loading=!0,a({url:"https://www.xinyueso.com/api/search/getHot",success:e=>{let a=[],t=[];try{t=e.data.data}catch(s){}for(let l of t)a.push({title:l.title,hot:l.hots,ranking:l.ranking});this.hot=a},complete:()=>{this.loading=!1}})},getNew(){this.loading2=!0,a({url:baseURL+"api/search/getNew",success:e=>{let a=[],t=[];try{t=e.data.data.items}catch(s){}for(let l of t)a.push({title:l.title,num:l.times});this.newList=a},complete:()=>{this.loading2=!1}})},getClass(){let e=[{value:"",text:"全部"}];a({url:baseURL+"api/search/getCategory",success:a=>{let t=a.data.data||[];for(let s of t)e.push({value:s.source_category_id,text:s.name});this.category=e}})}}},[["render",function(e,a,C,b,x,H){const L=t("Header"),U=y,V=k,F=c,I=B(s("uni-data-select"),v),R=w,S=t("Footer");return i(),l(F,{class:"view"},{default:o((()=>[n(L),n(F,{class:"homeBox"},{default:o((()=>[n(F,{class:"logoBox"},{default:o((()=>[n(U,{class:"logo",src:H.config?H.config.logo:""},null,8,["src"]),n(V,{class:"title"},{default:o((()=>[d(r(H.config?H.config.app_name:""),1)])),_:1})])),_:1}),n(F,{class:"subTitle"},{default:o((()=>[d(r(H.config?H.config.app_description:""),1)])),_:1}),n(F,{class:u(["search",x.category.length>2?"":"noSelect"])},{default:o((()=>[n(I,{class:"selectBox",modelValue:x.category_id,"onUpdate:modelValue":a[0]||(a[0]=e=>x.category_id=e),localdata:x.category,clear:!1},null,8,["modelValue","localdata"]),g("i",{class:"iconfont icon-sousuo",onClick:a[1]||(a[1]=(...e)=>H.searchBtn&&H.searchBtn(...e))}),n(R,{type:"text",modelValue:x.keyword,"onUpdate:modelValue":a[2]||(a[2]=e=>x.keyword=e),placeholder:"输入关键字进行搜索",onKeyup:f(H.searchBtn,["enter"]),"confirm-type":"search",onConfirm:H.searchBtn},null,8,["modelValue","onKeyup","onConfirm"])])),_:1},8,["class"]),n(F,{class:"content"},{default:o((()=>[n(F,{class:"tabs"},{default:o((()=>[n(F,{class:u(["item",0===x.tab?"active":""]),onClick:a[3]||(a[3]=e=>x.tab=0)},{default:o((()=>[d("热门资源")])),_:1},8,["class"]),n(F,{class:u(["item",1===x.tab?"active":""]),onClick:a[4]||(a[4]=e=>x.tab=1)},{default:o((()=>[d("最新资源")])),_:1},8,["class"])])),_:1}),0===x.tab?(i(),l(F,{key:0,class:"list"},{default:o((()=>[x.loading?(i(),l(F,{key:0,class:"loading"},{default:o((()=>[d("正在努力加载中...")])),_:1})):h("",!0),(i(!0),m(_,null,p(x.hot,((e,a)=>(i(),l(F,{class:"item",key:a,onClick:a=>H.goSearch(e.title)},{default:o((()=>[n(F,{class:"name"},{default:o((()=>[d(r(e.ranking)+"、"+r(e.title),1)])),_:2},1024),n(F,{class:"num"},{default:o((()=>[d(r(e.hot),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):h("",!0),1===x.tab?(i(),l(F,{key:1,class:"list"},{default:o((()=>[x.loading2?(i(),l(F,{key:0,class:"loading"},{default:o((()=>[d("正在努力加载中...")])),_:1})):h("",!0),(i(!0),m(_,null,p(x.newList,((e,a)=>(i(),l(F,{class:"item",key:a,onClick:a=>H.goSearch(e.title)},{default:o((()=>[n(F,{class:"name"},{default:o((()=>[d(r(a+1)+"、"+r(e.title),1)])),_:2},1024),n(F,{class:"num"},{default:o((()=>[d(r(e.num),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):h("",!0)])),_:1})])),_:1}),n(S)])),_:1})}],["__scopeId","data-v-df5dc4b2"]]);export{H as default}; diff --git a/public/robots.txt b/public/robots.txt index 447fce7..771983c 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,3 +1,3 @@ User-agent: * Disallow: -Sitemap: https://pan.xinyuedh.com/sitemap.xml \ No newline at end of file +Sitemap: https://www.xinyueso.com/sitemap.xml \ No newline at end of file