Skip to content

Commit

Permalink
0.9.29
Browse files Browse the repository at this point in the history
  • Loading branch information
helloxz committed Dec 23, 2022
1 parent 3bf4f73 commit 244667d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 9 deletions.
12 changes: 12 additions & 0 deletions auto_install.json
Original file line number Diff line number Diff line change
@@ -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":[]
}
9 changes: 4 additions & 5 deletions class/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -851,19 +851,18 @@ public function link_list($data){
$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}";
}

//如果token验证通过
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)";
Expand Down
2 changes: 1 addition & 1 deletion controller/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function base64($url){
"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="
],
Expand Down
9 changes: 8 additions & 1 deletion data/update.log
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,11 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
2. 修复书签分享私有链接无法查看的BUG
3. 带上?theme=参数可以指定主题
4. 新增heimdall主题
5. 新增OneNav主程序是否满足主题要求的检测
5. 新增OneNav主程序是否满足主题要求的检测

20221223
1. 修复登录页面引入CSS多出一个单引号的问题
2. 修复360搜索引擎出现的BUG
3. 修复通过分类筛选链接自定义图标不显示问题
4. 修复未登录情况下,API不显示链接列表的BUG
5. heimdall主题新增页脚部分
15 changes: 15 additions & 0 deletions nginx.rewrite
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion templates/admin/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./templates/admin/static/css/new.css?v=<?php echo $version; ?>'">
<link rel="stylesheet" href="./templates/admin/static/css/new.css?v=<?php echo $version; ?>">
<link rel='stylesheet' href='static/layui/css/layui.css'>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>OneNav管理员登录</title>
Expand Down
12 changes: 12 additions & 0 deletions templates/admin/static/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<img src="static/images/default.png" width="28" height="28">';
}
else
{
let random = getRandStr(4);
let font_icon = d.font_icon;
return `<img src="${font_icon}?random=${random}" width="28" height="28">`;
}
}}
// ,{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){
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.9.28-20221201
v0.9.29-20221223

0 comments on commit 244667d

Please sign in to comment.