mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-01 15:31:03 +00:00
修改删除
This commit is contained in:
parent
7ef393eb55
commit
d6ae5763b3
@ -463,17 +463,23 @@ class SystemCrud extends AuthController
|
||||
});
|
||||
|
||||
if ($info->make_path) {
|
||||
try {
|
||||
foreach ($info->make_path as $key => $item) {
|
||||
if (in_array($key, ['pages', 'router', 'api'])) {
|
||||
$item = Make::adminTemplatePath() . $item;
|
||||
} else {
|
||||
$item = app()->getRootPath() . $item;
|
||||
}
|
||||
unlink($item);
|
||||
$errorFile = [];
|
||||
foreach ($info->make_path as $key => $item) {
|
||||
if (in_array($key, ['pages', 'router', 'api'])) {
|
||||
$item = Make::adminTemplatePath() . $item;
|
||||
} else {
|
||||
$item = app()->getRootPath() . $item;
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return app('json')->success(500040, [], ['message' => $e->getMessage()]);
|
||||
try {
|
||||
unlink($item);
|
||||
} catch (\Throwable $e) {
|
||||
$errorFile[] = $item;
|
||||
}
|
||||
}
|
||||
if ($errorFile) {
|
||||
return app('json')->success(500040, [], [
|
||||
'message' => '文件:' . implode("\n", $errorFile) . ';无法被删除!'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user