框架升级及修复升级后的bug
This commit is contained in:
@@ -6,24 +6,22 @@ use app\common\controller\Backend;
|
||||
use app\common\exception\UploadException;
|
||||
use app\common\library\OssUpload;
|
||||
use app\common\library\Upload;
|
||||
use fast\Random;
|
||||
use think\addons\Service;
|
||||
use think\Cache;
|
||||
use think\Config;
|
||||
use think\Db;
|
||||
use think\Lang;
|
||||
use think\Loader;
|
||||
use think\Log;
|
||||
use think\Response;
|
||||
use think\Validate;
|
||||
|
||||
|
||||
/**
|
||||
* Ajax异步请求接口
|
||||
* @internal
|
||||
*/
|
||||
class Ajax extends Backend
|
||||
{
|
||||
|
||||
protected $noNeedLogin = ['lang'];
|
||||
protected $noNeedRight = ['*'];
|
||||
protected $layout = '';
|
||||
@@ -241,18 +239,18 @@ class Ajax extends Backend
|
||||
$weighdata[$v[$prikey]] = $v[$field];
|
||||
}
|
||||
$position = array_search($changeid, $ids);
|
||||
$desc_id = isset($sour[$position]) ? $sour[$position] : end($sour); //移动到目标的ID值,取出所处改变前位置的值
|
||||
$desc_id = $sour[$position] ?? end($sour); //移动到目标的ID值,取出所处改变前位置的值
|
||||
$sour_id = $changeid;
|
||||
$weighids = array();
|
||||
$weighids = [];
|
||||
$temp = array_values(array_diff_assoc($ids, $sour));
|
||||
foreach ($temp as $m => $n) {
|
||||
if ($n == $sour_id) {
|
||||
$offset = $desc_id;
|
||||
} else {
|
||||
if ($sour_id == $temp[0]) {
|
||||
$offset = isset($temp[$m + 1]) ? $temp[$m + 1] : $sour_id;
|
||||
$offset = $temp[$m + 1] ?? $sour_id;
|
||||
} else {
|
||||
$offset = isset($temp[$m - 1]) ? $temp[$m - 1] : $sour_id;
|
||||
$offset = $temp[$m - 1] ?? $sour_id;
|
||||
}
|
||||
}
|
||||
if (!isset($weighdata[$offset])) {
|
||||
@@ -273,7 +271,6 @@ class Ajax extends Backend
|
||||
$type = $this->request->request("type");
|
||||
switch ($type) {
|
||||
case 'all':
|
||||
// no break
|
||||
case 'content':
|
||||
//内容缓存
|
||||
rmdirs(CACHE_PATH, false);
|
||||
@@ -281,18 +278,21 @@ class Ajax extends Backend
|
||||
if ($type == 'content') {
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
case 'template':
|
||||
// 模板缓存
|
||||
rmdirs(TEMP_PATH, false);
|
||||
if ($type == 'template') {
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
case 'addons':
|
||||
// 插件缓存
|
||||
Service::refresh();
|
||||
if ($type == 'addons') {
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
case 'browser':
|
||||
// 浏览器缓存
|
||||
// 只有生产环境下才修改
|
||||
@@ -389,5 +389,4 @@ class Ajax extends Backend
|
||||
$response = Response::create($data, '', 200, $header);
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user