admin pass
This commit is contained in:
parent
ea760897cd
commit
6fd4c19a4d
@ -76,7 +76,8 @@ class Admin extends AdminController
|
||||
$data = Request::param();
|
||||
$data['create_time'] = time();
|
||||
$salt = substr(md5($data['create_time']),-6);
|
||||
$data['password'] = substr_replace(md5($data['password']),$salt,0,6);
|
||||
$data['password'] = md5(substr_replace(md5($data['password']),$salt,0,6));
|
||||
$data['status'] = 1;
|
||||
//$adminId = Db::name('admin')->insertGetId($data);
|
||||
$admin = Db::name('admin')->save($data);
|
||||
//Db::name('auth_group_access')->insert(['uid'=>$adminId,'group_id'=>$data['auth_group_id']]);
|
||||
|
@ -25,7 +25,7 @@ class Admin extends Model
|
||||
public function login($data)
|
||||
{
|
||||
//查询用户
|
||||
$admin = Db::name('admin')->where('username',$data['username'])->find();
|
||||
$admin = Db::name('admin')->where('username',$data['username'])->where('delete_time',0)->find();
|
||||
|
||||
if($admin['status'] !=1){
|
||||
return '用户被禁用或未审核,请联系管理员';
|
||||
|
@ -9,6 +9,12 @@
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">密码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="password" lay-verify="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">手机</label>
|
||||
@ -22,12 +28,6 @@
|
||||
<input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">审核状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="checkbox" lay-filter="switch" name="status" lay-skin="switch" lay-text="通过|待审核">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="LAY-user-back-submit" id="LAY-user-back-submit" value="确认">
|
||||
</div>
|
||||
|
@ -194,7 +194,7 @@
|
||||
type: 2
|
||||
,title: '添加管理员'
|
||||
,content: 'add.html'
|
||||
,area: ['420px', '420px']
|
||||
,area: ['400px', '380px']
|
||||
,btn: ['确定', '取消']
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
@ -209,7 +209,7 @@
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('admin/admin/add')}",
|
||||
data:{"username":field.username,"password":field.username,"mobile":field.mobile,"email":field.email,"auth_group_id":field.auth_group_id,"status":field.status},
|
||||
data:{"username":field.username,"password":field.password,"mobile":field.mobile,"email":field.email,"auth_group_id":field.auth_group_id,"status":field.status},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
|
@ -330,7 +330,7 @@ CREATE TABLE `tao_system` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='系统配置表';
|
||||
|
||||
INSERT INTO `tao_system` VALUES ('1', 'TaoLer社区演示站', '轻论坛系统', 'http://www.xxx.com', 'taoler', '/storage/logo/logo.png', '10', '2048', 'png|gif|jpg|jpeg|zip|rarr', '<a href=\"http://www.aieok.com\" target=\"_blank\">aieok.com 版权所有</a>', 'TaoLer,轻社区系统,bbs,论坛,Thinkphp6,layui,fly模板,', '这是一个Taoler轻社区论坛系统', '1', '1', '1', '0.0.0.0', '管理员|admin|审核员|超级|垃圾', '1.5.1', '', 'http://api.aieok.com/v1/index/cy', 'http://api.aieok.com/v1/upload/check', 'http://api.aieok.com/v1/upload/api', '1581221008', '1577419197');
|
||||
INSERT INTO `tao_system` VALUES ('1', 'TaoLer社区演示站', '轻论坛系统', 'http://www.xxx.com', 'taoler', '/storage/logo/logo.png', '10', '2048', 'png|gif|jpg|jpeg|zip|rarr', '<a href=\"http://www.aieok.com\" target=\"_blank\">aieok.com 版权所有</a>', 'TaoLer,轻社区系统,bbs,论坛,Thinkphp6,layui,fly模板,', '这是一个Taoler轻社区论坛系统', '1', '1', '1', '0.0.0.0', '管理员|admin|审核员|超级|垃圾', '1.5.2', '', 'http://api.aieok.com/v1/index/cy', 'http://api.aieok.com/v1/upload/check', 'http://api.aieok.com/v1/upload/api', '1581221008', '1577419197');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `tao_user`;
|
||||
|
Loading…
Reference in New Issue
Block a user