Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4ae29fed2 | ||
|
|
c82e1c8ea3 | ||
|
|
3f718beacb | ||
|
|
af44a9e7b8 | ||
|
|
4ed8237a00 | ||
|
|
216ca6e697 | ||
|
|
969a7a5ce5 | ||
|
|
5593a20009 |
@@ -109,7 +109,7 @@ class Index extends AdminController
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$save = $row->save([
|
$save = $row->save([
|
||||||
'password' => password($post['password']),
|
'password' => password_hash($post['password'], PASSWORD_DEFAULT),
|
||||||
]);
|
]);
|
||||||
}catch (Exception $e) {
|
}catch (Exception $e) {
|
||||||
$this->error('保存失败');
|
$this->error('保存失败');
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class Login extends AdminController
|
|||||||
if (empty($admin)) {
|
if (empty($admin)) {
|
||||||
$this->error('用户不存在');
|
$this->error('用户不存在');
|
||||||
}
|
}
|
||||||
if (password($post['password']) != $admin->password) {
|
if (!password_verify($post['password'], $admin->password)) {
|
||||||
$this->error('密码输入有误');
|
$this->error('密码输入有误');
|
||||||
}
|
}
|
||||||
if ($admin->status == 0) {
|
if ($admin->status == 0) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class Admin extends AdminController
|
|||||||
$rule = [];
|
$rule = [];
|
||||||
$this->validate($post, $rule);
|
$this->validate($post, $rule);
|
||||||
if (empty($post['password'])) $post['password'] = '123456';
|
if (empty($post['password'])) $post['password'] = '123456';
|
||||||
$post['password'] = password($post['password']);
|
$post['password'] = password_hash($post['password'],PASSWORD_DEFAULT);
|
||||||
try {
|
try {
|
||||||
$save = self::$model::create($post);
|
$save = self::$model::create($post);
|
||||||
}catch (\Exception $e) {
|
}catch (\Exception $e) {
|
||||||
@@ -114,7 +114,7 @@ class Admin extends AdminController
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$save = $row->save([
|
$save = $row->save([
|
||||||
'password' => password($post['password']),
|
'password' => password_hash($post['password'], PASSWORD_DEFAULT),
|
||||||
]);
|
]);
|
||||||
}catch (\Exception $e) {
|
}catch (\Exception $e) {
|
||||||
$this->error('保存失败');
|
$this->error('保存失败');
|
||||||
|
|||||||
@@ -1217,6 +1217,7 @@ class BuildCurd
|
|||||||
} elseif ($val['formType'] == 'images') {
|
} elseif ($val['formType'] == 'images') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}images";
|
$templateFile = "view{$this->DS}module{$this->DS}images";
|
||||||
$define = $val['define'] ?? '|';
|
$define = $val['define'] ?? '|';
|
||||||
|
if (strlen($define) > 5) $define = '|';
|
||||||
} elseif ($val['formType'] == 'file') {
|
} elseif ($val['formType'] == 'file') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}file";
|
$templateFile = "view{$this->DS}module{$this->DS}file";
|
||||||
} elseif ($val['formType'] == 'files') {
|
} elseif ($val['formType'] == 'files') {
|
||||||
@@ -1234,12 +1235,12 @@ class BuildCurd
|
|||||||
} elseif ($val['formType'] == 'radio') {
|
} elseif ($val['formType'] == 'radio') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}radio";
|
$templateFile = "view{$this->DS}module{$this->DS}radio";
|
||||||
if (!empty($val['define'])) {
|
if (!empty($val['define'])) {
|
||||||
$define = $this->buildRadioView($field, '{in name="k" value="' . $val['default'] . '"}checked=""{/in}');
|
$define = $this->buildRadioView($field, '');
|
||||||
}
|
}
|
||||||
} elseif ($val['formType'] == 'checkbox') {
|
} elseif ($val['formType'] == 'checkbox') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}checkbox";
|
$templateFile = "view{$this->DS}module{$this->DS}checkbox";
|
||||||
if (!empty($val['define'])) {
|
if (!empty($val['define'])) {
|
||||||
$define = $this->buildCheckboxView($field, '{in name="k" value="' . $val['default'] . '"}checked=""{/in}');
|
$define = $this->buildCheckboxView($field, '');
|
||||||
}
|
}
|
||||||
} elseif ($val['formType'] == 'select') {
|
} elseif ($val['formType'] == 'select') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}select";
|
$templateFile = "view{$this->DS}module{$this->DS}select";
|
||||||
@@ -1308,19 +1309,19 @@ class BuildCurd
|
|||||||
} elseif ($val['formType'] == 'radio') {
|
} elseif ($val['formType'] == 'radio') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}radio";
|
$templateFile = "view{$this->DS}module{$this->DS}radio";
|
||||||
if (!empty($val['define'])) {
|
if (!empty($val['define'])) {
|
||||||
$define = $this->buildRadioView($field, '{in name="k" value="$row.' . $field . '"}checked=""{/in}');
|
$define = $this->buildRadioView($field, '{if in_array($k, $row.' . $field . ')}checked{/if}');
|
||||||
}
|
}
|
||||||
} elseif ($val['formType'] == 'checkbox') {
|
} elseif ($val['formType'] == 'checkbox') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}checkbox";
|
$templateFile = "view{$this->DS}module{$this->DS}checkbox";
|
||||||
if (!empty($val['define'])) {
|
if (!empty($val['define'])) {
|
||||||
$define = $this->buildCheckboxView($field, '{in name="k" value="$row.' . $field . '"}checked=""{/in}');
|
$define = $this->buildCheckboxView($field, '{if in_array($k, $row.' . $field . ')}checked{/if}');
|
||||||
}
|
}
|
||||||
} elseif ($val['formType'] == 'select') {
|
} elseif ($val['formType'] == 'select') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}select";
|
$templateFile = "view{$this->DS}module{$this->DS}select";
|
||||||
if (isset($val['bindRelation'])) {
|
if (isset($val['bindRelation'])) {
|
||||||
$define = $this->buildOptionView($field, '{in name="k" value="$row.' . $field . '"}selected=""{/in}');
|
$define = $this->buildOptionView($field, '{if $row.' . $field . '==$k}selected{/if}');
|
||||||
} elseif (!empty($val['define'])) {
|
} elseif (!empty($val['define'])) {
|
||||||
$define = $this->buildOptionView($field, '{in name="k" value="$row.' . $field . '"}selected=""{/in}');
|
$define = $this->buildOptionView($field, '{if $row.' . $field . '==$k}selected{/if}');
|
||||||
}
|
}
|
||||||
} elseif ($field == 'remark' || $val['formType'] == 'textarea') {
|
} elseif ($field == 'remark' || $val['formType'] == 'textarea') {
|
||||||
$templateFile = "view{$this->DS}module{$this->DS}textarea";
|
$templateFile = "view{$this->DS}module{$this->DS}textarea";
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<li class="layui-nav-item mobile layui-hide-xs" lay-unselect>
|
<li class="layui-nav-item mobile layui-hide-xs" lay-unselect>
|
||||||
<a href="javascript:;" data-check-screen="full"><i class="fa fa-arrows-alt"></i></a>
|
<a href="javascript:;" data-check-screen="full"><i class="fa fa-arrows-alt"></i></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="layui-nav-item" lay-unselect>
|
<li class="layui-nav-item mobile layui-hide-xs" lay-unselect>
|
||||||
<div class="layui-form ws-header-theme" lay-filter="header-theme">
|
<div class="layui-form ws-header-theme" lay-filter="header-theme">
|
||||||
<input type="checkbox" name="theme-mode" lay-filter="header-theme-mode" lay-skin="switch">
|
<input type="checkbox" name="theme-mode" lay-filter="header-theme-mode" lay-skin="switch">
|
||||||
<div lay-checkbox>
|
<div lay-checkbox>
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ class Install extends BaseController
|
|||||||
$errorInfo = '已安装系统,如需重新安装请删除文件:/config/install/lock/install.lock,或者删除 /install 路由';
|
$errorInfo = '已安装系统,如需重新安装请删除文件:/config/install/lock/install.lock,或者删除 /install 路由';
|
||||||
}elseif (version_compare(phpversion(), '8.1.0', '<')) {
|
}elseif (version_compare(phpversion(), '8.1.0', '<')) {
|
||||||
$errorInfo = 'PHP版本不能小于8.1.0';
|
$errorInfo = 'PHP版本不能小于8.1.0';
|
||||||
}elseif (!extension_loaded("PDO")) {
|
}elseif (!extension_loaded("pdo_mysql")) {
|
||||||
$errorInfo = '当前未开启PDO,无法进行安装';
|
$errorInfo = '当前未开启pdo_mysql,无法进行安装';
|
||||||
}
|
}
|
||||||
if (!is_file(root_path() . '.env')) {
|
if (!is_file(root_path() . '.env')) {
|
||||||
$errorInfo = '.env 文件不存在,请先配置 .env 文件';
|
$errorInfo = '.env 文件不存在,请先配置 .env 文件';
|
||||||
@@ -105,12 +105,12 @@ class Install extends BaseController
|
|||||||
foreach ($sqlArray as $sql) {
|
foreach ($sqlArray as $sql) {
|
||||||
$pdo->query($sql);
|
$pdo->query($sql);
|
||||||
}
|
}
|
||||||
$_password = password($password);
|
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);
|
||||||
$tableName = 'system_admin';
|
$tableName = 'system_admin';
|
||||||
$update = [
|
$update = [
|
||||||
'username' => $username,
|
'username' => $username,
|
||||||
'head_img' => '/static/admin/images/head.jpg',
|
'head_img' => '/static/admin/images/head.jpg',
|
||||||
'password' => $_password,
|
'password' => $hashedPassword,
|
||||||
'create_time' => time(),
|
'create_time' => time(),
|
||||||
'update_time' => time()
|
'update_time' => time()
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ CREATE TABLE `ea_system_admin`
|
|||||||
`auth_ids` varchar(255) DEFAULT NULL COMMENT '角色权限ID',
|
`auth_ids` varchar(255) DEFAULT NULL COMMENT '角色权限ID',
|
||||||
`head_img` varchar(255) DEFAULT NULL COMMENT '头像',
|
`head_img` varchar(255) DEFAULT NULL COMMENT '头像',
|
||||||
`username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户登录名',
|
`username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户登录名',
|
||||||
`password` char(40) NOT NULL DEFAULT '' COMMENT '用户登录密码',
|
`password` varchar(255) NOT NULL DEFAULT '' COMMENT '用户登录密码',
|
||||||
`phone` varchar(16) DEFAULT NULL COMMENT '联系手机号',
|
`phone` varchar(16) DEFAULT NULL COMMENT '联系手机号',
|
||||||
`remark` varchar(255) DEFAULT '' COMMENT '备注说明',
|
`remark` varchar(255) DEFAULT '' COMMENT '备注说明',
|
||||||
`login_num` bigint(20) unsigned DEFAULT '0' COMMENT '登录次数',
|
`login_num` bigint(20) unsigned DEFAULT '0' COMMENT '登录次数',
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.addEventListener('keydown', function (event) {
|
||||||
|
if (event.key === 'Enter' || event.keyCode === 13) {
|
||||||
|
$('.login-btn').trigger('click')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('.login-tip').on('click', function () {
|
$('.login-tip').on('click', function () {
|
||||||
$('.icon-nocheck').click();
|
$('.icon-nocheck').click();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,13 +2,16 @@ define(["jquery", "tableSelect", "miniTheme", "xmSelect", "lazyload"], function
|
|||||||
|
|
||||||
//切换日夜模式
|
//切换日夜模式
|
||||||
window.onInitElemStyle = function () {
|
window.onInitElemStyle = function () {
|
||||||
miniTheme.renderElemStyle();
|
try {
|
||||||
$('iframe').each(function (index, iframe) {
|
miniTheme.renderElemStyle();
|
||||||
if (typeof iframe.contentWindow.onInitElemStyle == "function") {
|
$('iframe').each(function (index, iframe) {
|
||||||
iframe.contentWindow.onInitElemStyle();
|
if (typeof iframe.contentWindow.onInitElemStyle == "function") {
|
||||||
}
|
iframe.contentWindow.onInitElemStyle();
|
||||||
});
|
}
|
||||||
miniTheme.changeThemeMainColor();
|
});
|
||||||
|
miniTheme.changeThemeMainColor();
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
window.onInitElemStyle();
|
window.onInitElemStyle();
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-layout-admin .layuimini-logo h1 {
|
.layui-layout-admin .layuimini-logo h1 {
|
||||||
|
|||||||
@@ -94,7 +94,14 @@ define(["jquery"], function ($) {
|
|||||||
renderLeftMenu :function(leftMenus,options){
|
renderLeftMenu :function(leftMenus,options){
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var me = this ;
|
var me = this ;
|
||||||
var leftMenusHtml = me.each(leftMenus || [],function (idx,leftMenu) { // 左侧菜单遍历
|
let _i = 0
|
||||||
|
// 左侧菜单遍历
|
||||||
|
var leftMenusHtml = me.each(leftMenus || [],function (idx,leftMenu) {
|
||||||
|
$(leftMenu).each(function (index, child) {
|
||||||
|
options.childOpenClass = ''
|
||||||
|
if (child.child && child.child.length && _i === 0) options.childOpenClass = ' layui-nav-itemed'
|
||||||
|
_i++
|
||||||
|
})
|
||||||
var children = me.renderChildrenMenu(leftMenu.child, { childOpenClass:options.childOpenClass });
|
var children = me.renderChildrenMenu(leftMenu.child, { childOpenClass:options.childOpenClass });
|
||||||
var leftMenuHtml = me.compileMenu({
|
var leftMenuHtml = me.compileMenu({
|
||||||
href:leftMenu.href,
|
href:leftMenu.href,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user