Browse Source

Merge pull request #123 from helloxz/dev

0.9.29
main 0.9.29
xiaoz 2 years ago committed by GitHub
parent
commit
bd4f71990d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      auto_install.json
  2. 9
      class/Api.php
  3. 2
      controller/index.php
  4. 9
      data/update.log
  5. 15
      nginx.rewrite
  6. 2
      templates/admin/login.php
  7. 12
      templates/admin/static/embed.js
  8. 2
      version.txt

12
auto_install.json

@ -0,0 +1,12 @@ @@ -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
class/Api.php

@ -851,7 +851,7 @@ class Api { @@ -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 { @@ -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)";

2
controller/index.php

@ -223,7 +223,7 @@ $search_engines = [ @@ -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="
],

9
data/update.log

@ -180,4 +180,11 @@ CREATE INDEX on_options_key_IDX ON on_options ("key"); @@ -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
nginx.rewrite

@ -0,0 +1,15 @@ @@ -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
templates/admin/login.php

@ -5,7 +5,7 @@ @@ -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>

12
templates/admin/static/embed.js

@ -482,6 +482,18 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -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){

2
version.txt

@ -1 +1 @@ @@ -1 +1 @@
v0.9.28-20221201
v0.9.29-20221223
Loading…
Cancel
Save