Browse Source

0.9.27

pull/112/head
xiaoz 2 years ago
parent
commit
78169ddb7d
  1. 12
      class/Api.php
  2. 3
      data/update.log
  3. 6
      templates/mobile/assets/index.js
  4. 2
      version.txt

12
class/Api.php

@ -691,8 +691,13 @@ class Api {
public function category_list($page,$limit){ public function category_list($page,$limit){
$token = @$_POST['token']; $token = @$_POST['token'];
$offset = ($page - 1) * $limit; $offset = ($page - 1) * $limit;
//如果成功登录,则查询所有 /**
if( $this->is_login() || $this->auth('') ){ * name:如果成功登录,则查询所有
*
*/
//如果使用cookie登录成功,或者token不为空,则使用token进行验证
if( $this->is_login() || ( !empty($token) && $this->auth($token) ) ){
$sql = "SELECT *,(SELECT name FROM on_categorys WHERE id = a.fid LIMIT 1) AS fname FROM on_categorys as a ORDER BY weight DESC,id DESC LIMIT {$limit} OFFSET {$offset}"; $sql = "SELECT *,(SELECT name FROM on_categorys WHERE id = a.fid LIMIT 1) AS fname FROM on_categorys as a ORDER BY weight DESC,id DESC LIMIT {$limit} OFFSET {$offset}";
//统计总数 //统计总数
$count = $this->db->count('on_categorys','*'); $count = $this->db->count('on_categorys','*');
@ -755,7 +760,7 @@ class Api {
//$fid = @$data['category_id']; //$fid = @$data['category_id'];
$count = $this->db->count('on_links','*'); $count = $this->db->count('on_links','*');
//如果成功登录,但token为空 //如果成功登录,但token为空,获取所有
if( ($this->is_login()) && (empty($token)) ){ if( ($this->is_login()) && (empty($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}"; $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}";
} }
@ -765,6 +770,7 @@ class Api {
$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}"; $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 ) { 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}"; $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}";
} }

3
data/update.log

@ -171,3 +171,6 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
2. 新增:分类目录分享功能 2. 新增:分类目录分享功能
3. 修复默认主题的一些BUG 3. 修复默认主题的一些BUG
4. 其它优化和BUG修复 4. 其它优化和BUG修复
20221117
1. 修复获取分类目录失败的BUG

6
templates/mobile/assets/index.js

File diff suppressed because one or more lines are too long

2
version.txt

@ -1 +1 @@
v0.9.26-20221116 v0.9.27-20221117
Loading…
Cancel
Save