fix: layer notice
This commit is contained in:
@@ -15,9 +15,7 @@
|
||||
|
||||
`SWIFTADMIN` 是一款基于 webman + Layui 开发的 http 服务框架,提供了一个简单易用的(权限)后台管理系统,
|
||||
|
||||
拥有极简的封装扩展,特别适合中小企业和个人站长用于开发 web 站点或者 http 接口。支持路由、中间件、自动注入、多应用、
|
||||
|
||||
自定义进程、无需更改直接兼容现有 composer 项目组件等诸多特性。具有学习成本低、简单易用、超高性能、超高稳定性等特点。
|
||||
拥有极简的封装扩展,特别适合中小企业和个人站长用于开发 web 站点或者 http 接口。支持路由、中间件、自动注入、多应用、 自定义进程、无需更改直接兼容现有 composer 项目组件等诸多特性。具有学习成本低、简单易用、超高性能、超高稳定性等特点。
|
||||
|
||||
### 软件架构
|
||||
|
||||
|
||||
@@ -137,20 +137,18 @@ class Index extends BaseController
|
||||
}
|
||||
|
||||
// 查询数据库名
|
||||
$database = @mysqli_select_db($connect, $params['database']);
|
||||
if (!$database) {
|
||||
$query = "CREATE DATABASE IF NOT EXISTS `" . $params['database'] . "` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;";
|
||||
if (!@mysqli_query($connect, $query)) {
|
||||
return $this->error('数据库创建失败或已存在,请手动修改');
|
||||
}
|
||||
} else {
|
||||
$mysql_table = @mysqli_query($connect, 'SHOW TABLES FROM' . ' ' . $params['database']);
|
||||
$mysql_table = @mysqli_fetch_array($mysql_table);
|
||||
if (!empty($mysql_table) && is_array($mysql_table)) {
|
||||
$mysql_table = @mysqli_query($connect, 'SHOW DATABASES');
|
||||
while ($row = @mysqli_fetch_assoc($mysql_table)) {
|
||||
if ($row['Database'] == $params['database']) {
|
||||
return $this->error('数据表已存在,请勿重复安装');
|
||||
}
|
||||
}
|
||||
|
||||
$query = "CREATE DATABASE IF NOT EXISTS `" . $params['database'] . "` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;";
|
||||
if (!@mysqli_query($connect, $query)) {
|
||||
return $this->error('数据库创建失败或已存在,请手动修改');
|
||||
}
|
||||
|
||||
Cache::set('mysqlInfo', $params);
|
||||
return json(['code' => 200, 'url' => '/install/index/step3']);
|
||||
}
|
||||
@@ -248,7 +246,7 @@ class Index extends BaseController
|
||||
|
||||
// 清理安装包
|
||||
Cache::clear();
|
||||
recursive_delete(root_path('app' . DIRECTORY_SEPARATOR . 'install'));
|
||||
recursive_delete(root_path('app' . DIRECTORY_SEPARATOR . 'install'));
|
||||
system_reload();
|
||||
} catch (\Throwable $th) {
|
||||
return $this->error($th->getMessage());
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
location.href = res.url;
|
||||
}
|
||||
else {
|
||||
layer.msg(res.msg);
|
||||
layer.msg(res.msg,'error');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
location.href = res.url;
|
||||
}
|
||||
else {
|
||||
layer.msg(res.msg);
|
||||
layer.msg(res.msg,'error');
|
||||
}
|
||||
},'json');
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user