From 244667d05d2afd4fd393442f339d27a4b5b10dfc Mon Sep 17 00:00:00 2001 From: xiaoz Date: Fri, 23 Dec 2022 15:44:12 +0800 Subject: [PATCH] 0.9.29 --- auto_install.json | 12 ++++++++++++ class/Api.php | 9 ++++----- controller/index.php | 2 +- data/update.log | 9 ++++++++- nginx.rewrite | 15 +++++++++++++++ templates/admin/login.php | 2 +- templates/admin/static/embed.js | 12 ++++++++++++ version.txt | 2 +- 8 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 auto_install.json create mode 100644 nginx.rewrite diff --git a/auto_install.json b/auto_install.json new file mode 100644 index 0000000..7757cd0 --- /dev/null +++ b/auto_install.json @@ -0,0 +1,12 @@ +{ + "php_ext":"opcache", + "chmod":[], + "success_url":"/index.php", + "php_versions":"56,70,71,72,73,74", + "db_config":"", + "admin_username":"", + "admin_password":"", + "run_path":"/", + "remove_file":[], + "enable_functions":[] +} \ No newline at end of file diff --git a/class/Api.php b/class/Api.php index 4abcf6e..c6c44e3 100644 --- a/class/Api.php +++ b/class/Api.php @@ -851,7 +851,7 @@ class Api { $count = $this->db->count('on_links','*'); //如果成功登录,但token为空,获取所有 - if( ($this->is_login()) && (empty($token)) ){ + if( $this->is_login() || ( !empty($token) && $this->auth($token) ) ){ $sql = "SELECT *,(SELECT name FROM on_categorys WHERE id = on_links.fid) AS category_name FROM on_links ORDER BY weight DESC,id DESC LIMIT {$limit} OFFSET {$offset}"; } @@ -859,11 +859,10 @@ class Api { elseif( (!empty($token)) && ($this->auth($token)) ) { $sql = "SELECT *,(SELECT name FROM on_categorys WHERE id = on_links.fid) AS category_name FROM on_links ORDER BY weight DESC,id DESC LIMIT {$limit} OFFSET {$offset}"; } - //如果通过header传递的token验证成功,则获取所有 - else if( $this->auth("") === TRUE ) { - $sql = "SELECT *,(SELECT name FROM on_categorys WHERE id = on_links.fid) AS category_name FROM on_links ORDER BY weight DESC,id DESC LIMIT {$limit} OFFSET {$offset}"; - } + // else if( $this->auth("") === TRUE ) { + // $sql = "SELECT *,(SELECT name FROM on_categorys WHERE id = on_links.fid) AS category_name FROM on_links ORDER BY weight DESC,id DESC LIMIT {$limit} OFFSET {$offset}"; + // } //如果即没有登录成功,又没有token,则默认为游客,游客查询链接属性为公有,分类为公有,不查询私有 else{ $c_sql = "SELECT COUNT(*) AS num FROM on_links WHERE property = 0 AND fid IN (SELECT id FROM on_categorys WHERE property = 0)"; diff --git a/controller/index.php b/controller/index.php index 4c1311e..b1260d4 100755 --- a/controller/index.php +++ b/controller/index.php @@ -223,7 +223,7 @@ $search_engines = [ "name" => "搜狗", "url" => "https://www.sogou.com/web?query=" ], - "360" => [ + "so360" => [ "name" => "360搜索", "url" => "https://www.so.com/s?ie=utf-8&fr=none&src=360sou_newhome&ssid=&q=" ], diff --git a/data/update.log b/data/update.log index 75c38be..f7c5e9a 100755 --- a/data/update.log +++ b/data/update.log @@ -180,4 +180,11 @@ CREATE INDEX on_options_key_IDX ON on_options ("key"); 2. 修复书签分享私有链接无法查看的BUG 3. 带上?theme=参数可以指定主题 4. 新增heimdall主题 -5. 新增OneNav主程序是否满足主题要求的检测 \ No newline at end of file +5. 新增OneNav主程序是否满足主题要求的检测 + +20221223 +1. 修复登录页面引入CSS多出一个单引号的问题 +2. 修复360搜索引擎出现的BUG +3. 修复通过分类筛选链接自定义图标不显示问题 +4. 修复未登录情况下,API不显示链接列表的BUG +5. heimdall主题新增页脚部分 \ No newline at end of file diff --git a/nginx.rewrite b/nginx.rewrite new file mode 100644 index 0000000..9507f49 --- /dev/null +++ b/nginx.rewrite @@ -0,0 +1,15 @@ +#安全设置 +location ~* ^/(class|controller|db|data|functions|templates)/.*.(db3|php|php5|sql)$ { + return 403; +} +location ~* ^/(data)/.*.(html)$ { + deny all; +} +location /db { + deny all; +} + +#伪静态 +rewrite ^/click/(.*) /index.php?c=click&id=$1 break; +rewrite ^/api/(.*)?(.*) /index.php?c=api&method=$1&$2 break; +rewrite /login /index.php?c=login break; \ No newline at end of file diff --git a/templates/admin/login.php b/templates/admin/login.php index b44c31f..09003f7 100644 --- a/templates/admin/login.php +++ b/templates/admin/login.php @@ -5,7 +5,7 @@ - + OneNav管理员登录 diff --git a/templates/admin/static/embed.js b/templates/admin/static/embed.js index b58429d..8e8b8e9 100755 --- a/templates/admin/static/embed.js +++ b/templates/admin/static/embed.js @@ -482,6 +482,18 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ ,cols: [[ //表头 {type:'checkbox'} //开启复选框 ,{field: 'id', title: 'ID', width:80, sort: true} + ,{field: 'font_icon', title: '图标', width:60, templet:function(d){ + if(d.font_icon == null || d.font_icon == "") + { + return ''; + } + else + { + let random = getRandStr(4); + let font_icon = d.font_icon; + return ``; + } + }} // ,{field: 'fid', title: '分类ID',sort:true, width:90} ,{field: 'category_name', title: '所属分类',sort:true,width:120} ,{field: 'url', title: 'URL',width:140,templet:function(d){ diff --git a/version.txt b/version.txt index ffbf09b..68c3c12 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.9.28-20221201 \ No newline at end of file +v0.9.29-20221223 \ No newline at end of file