mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 11:02:48 +08:00
修改更新的逻辑
This commit is contained in:
@@ -106,9 +106,9 @@ class AdminUpdateServiceBase
|
|||||||
// 完全跳过runtime、vendor、.git目录
|
// 完全跳过runtime、vendor、.git目录
|
||||||
|
|
||||||
$ignore_prefix = [
|
$ignore_prefix = [
|
||||||
'runtime' => 'recursive',
|
'runtime',
|
||||||
'vendor' => 'recursive',
|
'vendor',
|
||||||
'.git' => 'recursive',
|
'.git',
|
||||||
];
|
];
|
||||||
|
|
||||||
$filter_files_function = function (StorageAttributes $attributes) use ($ignore_prefix) {
|
$filter_files_function = function (StorageAttributes $attributes) use ($ignore_prefix) {
|
||||||
@@ -178,12 +178,12 @@ class AdminUpdateServiceBase
|
|||||||
// 最新版本有,但是现存版本没有,有可能是新版本增加的,也有可能是用户删除的
|
// 最新版本有,但是现存版本没有,有可能是新版本增加的,也有可能是用户删除的
|
||||||
if ($this->testIsOptionalFiles($file_path)) {
|
if ($this->testIsOptionalFiles($file_path)) {
|
||||||
// 判断是否是新版本增加的
|
// 判断是否是新版本增加的
|
||||||
if(in_array($file_path, $current_version_files)){
|
if (in_array($file_path, $current_version_files)) {
|
||||||
// 如果是新版本增加的,则直接处理
|
// 如果是新版本增加的,则直接处理
|
||||||
$need_process_files[$file_path] = $type;
|
$need_process_files[$file_path] = $type;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是用户删除了的,则提示用户处理
|
// 如果是用户删除了的,则提示用户处理
|
||||||
$optional_update_waring_files[$file_path] = $type;
|
$optional_update_waring_files[$file_path] = $type;
|
||||||
continue;
|
continue;
|
||||||
@@ -210,11 +210,10 @@ class AdminUpdateServiceBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->testIsOptionalFiles($file_path)) {
|
if ($this->testIsOptionalFiles($file_path)) {
|
||||||
|
if ($type == 'delete') {
|
||||||
if($type == 'delete'){
|
|
||||||
// 最新版本没有,但是现存版本有,有可能是新版本删除的,也有可能是用户增加的
|
// 最新版本没有,但是现存版本有,有可能是新版本删除的,也有可能是用户增加的
|
||||||
|
|
||||||
if(in_array($file_path, $current_version_files)){
|
if (in_array($file_path, $current_version_files)) {
|
||||||
// 如果这个文件在当前版本中存在,则是新版本删除的,提示用户处理,因为用户改动了他,可能不希望被删除
|
// 如果这个文件在当前版本中存在,则是新版本删除的,提示用户处理,因为用户改动了他,可能不希望被删除
|
||||||
$optional_update_waring_files[$file_path] = $type;
|
$optional_update_waring_files[$file_path] = $type;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user