mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-14 11:42:48 +00:00
update
This commit is contained in:
parent
36c283a950
commit
bffc51a8f9
@ -182,7 +182,7 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
|||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
$install_step = ['installDir','installSql','installMenu','installSchedule','installWap','installDepend'];
|
$install_step = ['installDir','installWap','installDepend'];
|
||||||
|
|
||||||
if (!empty($install_data['compile']) || $mode == 'cloud') {
|
if (!empty($install_data['compile']) || $mode == 'cloud') {
|
||||||
// 备份前端目录
|
// 备份前端目录
|
||||||
@ -225,7 +225,8 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Cache::set('install_task', null);
|
Cache::set('install_task', $this->install_task);
|
||||||
|
$this->installExceptionHandle();
|
||||||
throw new CommonException($e->getMessage());
|
throw new CommonException($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -241,8 +242,8 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
|||||||
@$this->uninstallDir();
|
@$this->uninstallDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('installMenu', $install_task['step'])) {
|
if (in_array('installWap', $install_task['step'])) {
|
||||||
@$this->uninstallMenu();
|
@$this->uninstallWap();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($install_task['mode'] == 'cloud') {
|
if ($install_task['mode'] == 'cloud') {
|
||||||
@ -376,6 +377,13 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
|||||||
*/
|
*/
|
||||||
public function handleAddonInstall()
|
public function handleAddonInstall()
|
||||||
{
|
{
|
||||||
|
// 执行安装sql
|
||||||
|
$this->installSql();
|
||||||
|
// 安装菜单
|
||||||
|
$this->installMenu();
|
||||||
|
// 安装计划任务
|
||||||
|
$this->installSchedule();
|
||||||
|
|
||||||
$core_addon_service = new CoreAddonService();
|
$core_addon_service = new CoreAddonService();
|
||||||
$install_data = $this->getAddonConfig($this->addon);
|
$install_data = $this->getAddonConfig($this->addon);
|
||||||
$install_data['icon'] = 'addon/' . $this->addon . '/icon.png';
|
$install_data['icon'] = 'addon/' . $this->addon . '/icon.png';
|
||||||
@ -737,90 +745,4 @@ class CoreAddonInstallService extends CoreAddonBaseService
|
|||||||
$this->state = self::SCHEDULE_INSTALLED;
|
$this->state = self::SCHEDULE_INSTALLED;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 编译admin端
|
|
||||||
* @return true
|
|
||||||
*/
|
|
||||||
public function buildAdmin()
|
|
||||||
{
|
|
||||||
$result = Terminal::execute(root_path() . '../admin/', 'npm run build');
|
|
||||||
if ($result !== true) {
|
|
||||||
throw new CommonException($result);
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 覆盖admin端
|
|
||||||
* @return true
|
|
||||||
*/
|
|
||||||
public function coverAdmin()
|
|
||||||
{
|
|
||||||
// admin编译后文件目录
|
|
||||||
$dist_dir = $this->root_path . "admin" . DIRECTORY_SEPARATOR . 'dist' . DIRECTORY_SEPARATOR;
|
|
||||||
// admin端代码目录
|
|
||||||
$target_dir = public_path() . "admin";
|
|
||||||
|
|
||||||
dir_copy($dist_dir, $target_dir);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编译wap端
|
|
||||||
* @return true
|
|
||||||
*/
|
|
||||||
public function buildWap()
|
|
||||||
{
|
|
||||||
$result = Terminal::execute(root_path() . '../uni-app/', 'npm run build:h5');
|
|
||||||
if ($result !== true) {
|
|
||||||
throw new CommonException($result);
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 覆盖admin端
|
|
||||||
* @return true
|
|
||||||
*/
|
|
||||||
public function coverWap()
|
|
||||||
{
|
|
||||||
// admin编译后文件目录
|
|
||||||
$dist_dir = $this->root_path . "uni-app" . DIRECTORY_SEPARATOR . 'dist' . DIRECTORY_SEPARATOR;
|
|
||||||
// admin端代码目录
|
|
||||||
$target_dir = public_path() . "wap";
|
|
||||||
|
|
||||||
dir_copy($dist_dir, $target_dir);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编译web端
|
|
||||||
* @return true
|
|
||||||
*/
|
|
||||||
public function buildWeb()
|
|
||||||
{
|
|
||||||
$result = Terminal::execute(root_path() . '../web/', 'npm run generate');
|
|
||||||
if ($result !== true) {
|
|
||||||
throw new CommonException($result);
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 覆盖admin端
|
|
||||||
* @return true
|
|
||||||
*/
|
|
||||||
public function coverWeb()
|
|
||||||
{
|
|
||||||
// admin编译后文件目录
|
|
||||||
$dist_dir = $this->root_path . "web" . DIRECTORY_SEPARATOR . '.output' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR;
|
|
||||||
// admin端代码目录
|
|
||||||
$target_dir = public_path() . "web";
|
|
||||||
|
|
||||||
dir_copy($dist_dir, $target_dir);
|
|
||||||
del_target_dir($target_dir, true);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class CoreSysConfigService extends BaseCoreService
|
|||||||
*/
|
*/
|
||||||
public function getCopyright()
|
public function getCopyright()
|
||||||
{
|
{
|
||||||
$info = ( new CoreConfigService() )->getConfig(0, 'COPYRIGHT');
|
$info = ( new CoreConfigService() )->getConfig('COPYRIGHT');
|
||||||
if (empty($info)) {
|
if (empty($info)) {
|
||||||
$info = [];
|
$info = [];
|
||||||
$info[ 'value' ] = [
|
$info[ 'value' ] = [
|
||||||
@ -99,4 +99,4 @@ class CoreSysConfigService extends BaseCoreService
|
|||||||
|
|
||||||
return $index_list;
|
return $index_list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user