Skip to content

Commit bd4f719

Browse files
authored
Merge pull request helloxz#123 from helloxz/dev
0.9.29
2 parents 1f4b482 + 244667d commit bd4f719

File tree

8 files changed

+54
-9
lines changed

8 files changed

+54
-9
lines changed

auto_install.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"php_ext":"opcache",
3+
"chmod":[],
4+
"success_url":"/index.php",
5+
"php_versions":"56,70,71,72,73,74",
6+
"db_config":"",
7+
"admin_username":"",
8+
"admin_password":"",
9+
"run_path":"/",
10+
"remove_file":[],
11+
"enable_functions":[]
12+
}

class/Api.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -851,19 +851,18 @@ public function link_list($data){
851851
$count = $this->db->count('on_links','*');
852852

853853
//如果成功登录,但token为空,获取所有
854-
if( ($this->is_login()) && (empty($token)) ){
854+
if( $this->is_login() || ( !empty($token) && $this->auth($token) ) ){
855855
$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}";
856856
}
857857

858858
//如果token验证通过
859859
elseif( (!empty($token)) && ($this->auth($token)) ) {
860860
$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}";
861861
}
862-
863862
//如果通过header传递的token验证成功,则获取所有
864-
else if( $this->auth("") === TRUE ) {
865-
$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}";
866-
}
863+
// else if( $this->auth("") === TRUE ) {
864+
// $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}";
865+
// }
867866
//如果即没有登录成功,又没有token,则默认为游客,游客查询链接属性为公有,分类为公有,不查询私有
868867
else{
869868
$c_sql = "SELECT COUNT(*) AS num FROM on_links WHERE property = 0 AND fid IN (SELECT id FROM on_categorys WHERE property = 0)";

controller/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function base64($url){
223223
"name" => "搜狗",
224224
"url" => "https://www.sogou.com/web?query="
225225
],
226-
"360" => [
226+
"so360" => [
227227
"name" => "360搜索",
228228
"url" => "https://www.so.com/s?ie=utf-8&fr=none&src=360sou_newhome&ssid=&q="
229229
],

data/update.log

+8-1
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,11 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
180180
2. 修复书签分享私有链接无法查看的BUG
181181
3. 带上?theme=参数可以指定主题
182182
4. 新增heimdall主题
183-
5. 新增OneNav主程序是否满足主题要求的检测
183+
5. 新增OneNav主程序是否满足主题要求的检测
184+
185+
20221223
186+
1. 修复登录页面引入CSS多出一个单引号的问题
187+
2. 修复360搜索引擎出现的BUG
188+
3. 修复通过分类筛选链接自定义图标不显示问题
189+
4. 修复未登录情况下,API不显示链接列表的BUG
190+
5. heimdall主题新增页脚部分

nginx.rewrite

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#安全设置
2+
location ~* ^/(class|controller|db|data|functions|templates)/.*.(db3|php|php5|sql)$ {
3+
return 403;
4+
}
5+
location ~* ^/(data)/.*.(html)$ {
6+
deny all;
7+
}
8+
location /db {
9+
deny all;
10+
}
11+
12+
#伪静态
13+
rewrite ^/click/(.*) /index.php?c=click&id=$1 break;
14+
rewrite ^/api/(.*)?(.*) /index.php?c=api&method=$1&$2 break;
15+
rewrite /login /index.php?c=login break;

templates/admin/login.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<link rel="stylesheet" href="./templates/admin/static/css/new.css?v=<?php echo $version; ?>'">
8+
<link rel="stylesheet" href="./templates/admin/static/css/new.css?v=<?php echo $version; ?>">
99
<link rel='stylesheet' href='static/layui/css/layui.css'>
1010
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
1111
<title>OneNav管理员登录</title>

templates/admin/static/embed.js

+12
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,18 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
482482
,cols: [[ //表头
483483
{type:'checkbox'} //开启复选框
484484
,{field: 'id', title: 'ID', width:80, sort: true}
485+
,{field: 'font_icon', title: '图标', width:60, templet:function(d){
486+
if(d.font_icon == null || d.font_icon == "")
487+
{
488+
return '<img src="static/images/default.png" width="28" height="28">';
489+
}
490+
else
491+
{
492+
let random = getRandStr(4);
493+
let font_icon = d.font_icon;
494+
return `<img src="${font_icon}?random=${random}" width="28" height="28">`;
495+
}
496+
}}
485497
// ,{field: 'fid', title: '分类ID',sort:true, width:90}
486498
,{field: 'category_name', title: '所属分类',sort:true,width:120}
487499
,{field: 'url', title: 'URL',width:140,templet:function(d){

version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.9.28-20221201
1+
v0.9.29-20221223

0 commit comments

Comments
 (0)