mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 02:52:49 +08:00
调整更新的append的逻辑;为login增加trait扩展机制;发布新版本
This commit is contained in:
@@ -7,12 +7,15 @@ use app\common\controller\AdminController;
|
||||
use think\captcha\facade\Captcha;
|
||||
use think\facade\Env;
|
||||
use think\facade\Event;
|
||||
use trait\admin\controller\LoginTrait;
|
||||
|
||||
/**
|
||||
* Class Login.
|
||||
*/
|
||||
class Login extends AdminController
|
||||
{
|
||||
use LoginTrait;
|
||||
|
||||
/**
|
||||
* 初始化方法.
|
||||
*/
|
||||
@@ -33,7 +36,6 @@ class Login extends AdminController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$captcha = Env::get('adminsystem.captcha', 1);
|
||||
if ($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
|
||||
@@ -210,6 +210,67 @@ class Update extends Command
|
||||
file_put_contents($now_file_path, $file_content);
|
||||
}
|
||||
|
||||
// 处理append的文件
|
||||
$last_version_list_skip_files = $last_version_filesystem->listContents('/', Filesystem::LIST_DEEP)
|
||||
->filter(function (StorageAttributes $attributes) use ($last_version_skip_config) {
|
||||
if ($attributes->isDir()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$path = $attributes->path();
|
||||
|
||||
if (str_starts_with($path, '.git')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$skip_files = $last_version_skip_config['skip_files'] ?? [];
|
||||
|
||||
if (in_array($path, $skip_files)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$skip_dir = $last_version_skip_config['skip_dir'] ?? [];
|
||||
|
||||
foreach ($skip_dir as $dir) {
|
||||
if (str_starts_with($path, $dir)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
->map(fn (StorageAttributes $attributes) => $attributes->path())
|
||||
->toArray();
|
||||
|
||||
$last_version_list_append_files = [];
|
||||
|
||||
foreach ($last_version_list_skip_files as $file_path) {
|
||||
if (in_array($file_path, $last_version_skip_config['append_files'])) {
|
||||
$last_version_list_append_files[] = $file_path;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($last_version_skip_config['append_dir'] as $dir) {
|
||||
if(str_starts_with($file_path,$dir)){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($last_version_list_append_files as $file_path) {
|
||||
$now_file_path = $now_dir. '/'. $file_path;
|
||||
$last_file_path = $last_version_dir. '/'. $file_path;
|
||||
|
||||
if(file_exists($now_file_path)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$file_content = file_get_contents($last_file_path);
|
||||
|
||||
PathTools::intiDir($now_file_path);
|
||||
file_put_contents($now_file_path, $file_content);
|
||||
}
|
||||
|
||||
// 检测now的composer依赖和最新的composer依赖
|
||||
|
||||
$last_composer_json = file_get_contents($last_version_dir . '/composer.json');
|
||||
|
||||
@@ -14,12 +14,13 @@ use think\facade\App;
|
||||
|
||||
class Version extends Command
|
||||
{
|
||||
public const VERSION = 'v2.0.33';
|
||||
public const VERSION = 'v2.0.34';
|
||||
|
||||
public const LAYUI_VERSION = '2.8.16';
|
||||
|
||||
public const COMMENT = [
|
||||
'调整更新的文件替换逻辑;',
|
||||
'调整更新的append的逻辑',
|
||||
'为login增加trait扩展机制',
|
||||
];
|
||||
|
||||
protected function configure()
|
||||
|
||||
Reference in New Issue
Block a user