first commit
This commit is contained in:
22
catchAdmin/CatchAdminService.php
Normal file
22
catchAdmin/CatchAdminService.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace catchAdmin;
|
||||
|
||||
use catcher\command\InstallCommand;
|
||||
use catcher\command\ModuleCacheCommand;
|
||||
use think\Service;
|
||||
|
||||
class CatchAdminService extends Service
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @time 2019年11月29日
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->commands([
|
||||
InstallCommand::class,
|
||||
ModuleCacheCommand::class,
|
||||
]);
|
||||
}
|
||||
}
|
22
catchAdmin/helper.php
Normal file
22
catchAdmin/helper.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 模块 view path
|
||||
*
|
||||
*/
|
||||
|
||||
use think\helper\Arr;
|
||||
|
||||
if (!function_exists('getModuleViewPath()')) {
|
||||
function getModuleViewPath($module) {
|
||||
|
||||
if (file_exists($views = app()->getRuntimePath() . 'module' . DIRECTORY_SEPARATOR . 'view.php')) {
|
||||
$views = include $views;
|
||||
|
||||
return $views[$module];
|
||||
} else {
|
||||
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
12
catchAdmin/index/controller/Index.php
Normal file
12
catchAdmin/index/controller/Index.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace catchAdmin\index\controller;
|
||||
|
||||
use app\BaseController;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function index(): string
|
||||
{
|
||||
return $this->fetch('index::index');
|
||||
}
|
||||
}
|
13
catchAdmin/index/module.json
Normal file
13
catchAdmin/index/module.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "首页管理",
|
||||
"alias": "index",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"order": 0,
|
||||
"services": [
|
||||
"catchAdmin\\index\\IndexService"
|
||||
],
|
||||
"aliases": {},
|
||||
"files": [],
|
||||
"requires": []
|
||||
}
|
3
catchAdmin/index/route.php
Normal file
3
catchAdmin/index/route.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$router->get('/', '\catchAdmin\index\controller\index/index');
|
252
catchAdmin/index/view/index.html
Normal file
252
catchAdmin/index/view/index.html
Normal file
@@ -0,0 +1,252 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link href="./assets/images/favicon.ico" rel="icon">
|
||||
<title>EasyWeb后台开发框架</title>
|
||||
<link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css"/>
|
||||
<link rel="stylesheet" href="/static/assets/module/admin.css?v=315"/>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
<!-- 头部 -->
|
||||
<div class="layui-header">
|
||||
<div class="layui-logo">
|
||||
<img src="/static/assets/images/logo.png"/>
|
||||
<cite> EasyWeb Iframe</cite>
|
||||
</div>
|
||||
<ul class="layui-nav layui-layout-left">
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
|
||||
</li>
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a ew-event="message" title="消息">
|
||||
<i class="layui-icon layui-icon-notice"></i>
|
||||
<span class="layui-badge-dot"></span><!--小红点-->
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a ew-event="note" title="便签"><i class="layui-icon layui-icon-note"></i></a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-hide-xs" lay-unselect>
|
||||
<a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
|
||||
</li>
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a>
|
||||
<img src="assets/images/head.png" class="layui-nav-img">
|
||||
<cite>管理员</cite>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd lay-unselect>
|
||||
<a ew-href="page/template/user-info.html">个人中心</a>
|
||||
</dd>
|
||||
<dd lay-unselect>
|
||||
<a ew-event="psw">修改密码</a>
|
||||
</dd>
|
||||
<hr>
|
||||
<dd lay-unselect>
|
||||
<a ew-event="logout" data-url="page/template/login.html">退出</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 侧边栏 -->
|
||||
<div class="layui-side">
|
||||
<div class="layui-side-scroll">
|
||||
<ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-accordion="true"
|
||||
style="margin-top: 15px;">
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-home"></i> <cite>Dashboard</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/console/console.html">控制台</a></dd>
|
||||
<dd><a lay-href="page/console/introduction.html">介绍页</a></dd>
|
||||
<dd><a lay-href="page/console/dashboard.html">分析页</a></dd>
|
||||
<dd><a lay-href="page/console/welcome.html">欢迎页</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-set"></i> <cite>系统管理</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/system/user.html">用户管理</a></dd>
|
||||
<dd><a lay-href="page/system/role.html">角色管理</a></dd>
|
||||
<dd><a lay-href="page/system/authorities.html">菜单管理</a></dd>
|
||||
<dd><a lay-href="page/system/loginRecord.html">登录日志</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-template"></i> <cite>模板页面</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a>表单页</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/template/form/form-basic.html">基础表单</a></dd>
|
||||
<dd><a lay-href="page/template/form/form-advance.html">复杂表单</a></dd>
|
||||
<dd><a lay-href="page/template/form/form-step.html">分步表单</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>表格页</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/template/table/table-basic.html">数据表格</a></dd>
|
||||
<dd><a lay-href="page/template/table/table-advance.html">复杂查询</a></dd>
|
||||
<dd><a lay-href="page/template/table/table-ltrt.html">左树右表</a></dd>
|
||||
<dd><a lay-href="page/template/table/table-img.html">表格缩略图</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>错误页</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/template/error/error-500.html">500</a></dd>
|
||||
<dd><a lay-href="page/template/error/error-404.html">404</a></dd>
|
||||
<dd><a lay-href="page/template/error/error-403.html">403</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd><a lay-href="page/template/user-info.html">个人中心</a></dd>
|
||||
<dd><a lay-href="page/template/empty.html">空白页面</a></dd>
|
||||
<dd><a href="page/template/login.html" target="_blank">登录页面</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-component"></i> <cite>扩展组件</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a>常用组件</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/plugin/basic/dialog.html">弹出层</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/dropdown.html">下拉菜单</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/cascader.html">级联选择器</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/notice.html">消息通知</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/tips.html">文字提示</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/tagsInput.html">标签输入</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/split.html">分割面板</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/circleProgress.html">圆形进度条</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>进阶组件</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/plugin/advance/tableX.html">表格扩展</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/formX.html">表单扩展</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/dataGrid.html">数据列表</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/printer.html">打印插件</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/ckeditor.html">富文本编辑</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/player.html">视频播放器</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/introJs.html">引导插件</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>工具组件</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/plugin/util/contextMenu.html">ContextMenu</a></dd>
|
||||
<dd><a lay-href="page/plugin/util/mousewheel.html">MouseWheel</a></dd>
|
||||
<dd><a lay-href="page/plugin/util/other.html">其他</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd><a lay-href="page/plugin/more.html">更多扩展</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-app"></i> <cite>经典实例</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/example/dialog.html">弹窗实例</a></dd>
|
||||
<dd><a lay-href="page/example/syxm.html">经典实例2</a></dd>
|
||||
<dd><a lay-href="page/example/form.html">表单实例</a></dd>
|
||||
<dd><a lay-href="page/example/file.html">文件管理</a></dd>
|
||||
<dd><a lay-href="page/example/table-crud.html">表格CRUD</a></dd>
|
||||
<dd><a href="page/example/side-more.html" target="_blank">多系统模式</a></dd>
|
||||
<dd><a href="page/example/side-ajax.html" target="_blank">Ajax侧边栏</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-release"></i> <cite>LayUI组件</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="https://www.layui.com/demo/button.html">组件演示</a></dd>
|
||||
<dd><a lay-href="https://www.layui.com/doc/element/button.html#use">layui文档</a></dd>
|
||||
<dd><a lay-href="https://layer.layui.com/">layer弹窗组件</a></dd>
|
||||
<dd><a lay-href="https://www.layui.com/laydate/">laydate日期组件</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-unlink"></i> <cite>多级菜单</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>二级菜单</a></dd>
|
||||
<dd>
|
||||
<a>二级菜单</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>三级菜单</a></dd>
|
||||
<dd>
|
||||
<a>三级菜单</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>四级菜单</a></dd>
|
||||
<dd>
|
||||
<a>四级菜单</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>五级菜单</a></dd>
|
||||
<dd>
|
||||
<a lay-href="https://baidu.com">百度一下</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a lay-href="//baidu.com"><i class="layui-icon layui-icon-unlink"></i> <cite>一级菜单</cite></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主体部分 -->
|
||||
<div class="layui-body"></div>
|
||||
<!-- 底部 -->
|
||||
<div class="layui-footer">
|
||||
copyright © 2019 <a href="http://easyweb.vip" target="_blank">easyweb.vip</a> all rights reserved.
|
||||
<span class="pull-right">Version 3.1.5</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 加载动画 -->
|
||||
<div class="page-loading">
|
||||
<div class="ball-loader">
|
||||
<span></span><span></span><span></span><span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- js部分 -->
|
||||
<script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="/static/assets/js/common.js?v=315"></script>
|
||||
<script>
|
||||
layui.use(['index'], function () {
|
||||
var $ = layui.jquery;
|
||||
var index = layui.index;
|
||||
|
||||
// 默认加载主页
|
||||
index.loadHome({
|
||||
menuPath: 'page/console/console.html',
|
||||
menuName: '<i class="layui-icon layui-icon-home"></i>'
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
56
catchAdmin/login/Auth.php
Normal file
56
catchAdmin/login/Auth.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace catchAdmin\login;
|
||||
|
||||
use app\exceptions\LoginFailedException;
|
||||
use think\Db;
|
||||
use think\facade\Session;
|
||||
|
||||
class Auth
|
||||
{
|
||||
protected $loginUser = 'admin_user';
|
||||
|
||||
/**
|
||||
* Auth constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->loginUser = md5($this->loginUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
*
|
||||
* @time 2019年11月28日
|
||||
* @param $params
|
||||
* @throws LoginFailedException
|
||||
* @return bool
|
||||
*/
|
||||
public function login($params)
|
||||
{
|
||||
$user = Db::table('admin_users')
|
||||
->where('name', $params['name'])
|
||||
// ->where('password', $params['password'])
|
||||
->first();
|
||||
|
||||
if (!password_verify($params('password'), $user->password)) {
|
||||
throw new LoginFailedException('登陆失败, 请检查用户名和密码');
|
||||
}
|
||||
|
||||
Session::set($this->loginUser, $user);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登陆
|
||||
*
|
||||
* @time 2019年11月28日
|
||||
* @return bool
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
Session::delete($this->loginUser);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
49
catchAdmin/login/controller/Index.php
Normal file
49
catchAdmin/login/controller/Index.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace catchAdmin\login\controller;
|
||||
|
||||
use app\BaseController;
|
||||
use catchAdmin\login\Auth;
|
||||
use catchAdmin\login\request\LoginRequest;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
* @time 2019年11月30日
|
||||
* @throws \Exception
|
||||
* @return string
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return $this->fetch('login::index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
*
|
||||
* @time 2019年11月28日
|
||||
* @param LoginRequest $request
|
||||
* @return bool|string
|
||||
* @throws \app\exceptions\LoginFailedException
|
||||
*/
|
||||
public function login(LoginRequest $request)
|
||||
{
|
||||
(new Auth())->login($request->post());
|
||||
}
|
||||
|
||||
/**
|
||||
* 登出
|
||||
*
|
||||
* @time 2019年11月28日
|
||||
* @return bool
|
||||
*/
|
||||
public function logout(): bool
|
||||
{
|
||||
if ((new Auth())->logout()) {
|
||||
return redirect(url('login'));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
13
catchAdmin/login/module.json
Normal file
13
catchAdmin/login/module.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "登陆",
|
||||
"alias": "login",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"order": 1,
|
||||
"services": [
|
||||
"catchAdmin\\login\\LoginService"
|
||||
],
|
||||
"aliases": {},
|
||||
"files": [],
|
||||
"requires": []
|
||||
}
|
19
catchAdmin/login/request/LoginRequest.php
Normal file
19
catchAdmin/login/request/LoginRequest.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace catchAdmin\login\request;
|
||||
|
||||
use app\Request;
|
||||
use catchAdmin\login\validate\LoginValidate;
|
||||
|
||||
class LoginRequest extends Request
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @time 2019年11月27日
|
||||
* @return string
|
||||
*/
|
||||
protected function getValidate()
|
||||
{
|
||||
// TODO: Implement getValidate() method.
|
||||
return new LoginValidate();
|
||||
}
|
||||
}
|
8
catchAdmin/login/route.php
Normal file
8
catchAdmin/login/route.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
# 登陆页面
|
||||
$router->get('login', '\catchAdmin\login\controller\Index/index');
|
||||
# 登入
|
||||
$router->post('login', '\catchAdmin\login\controller\Index/login');
|
||||
# 登出
|
||||
$router->post('logout', '\catchAdmin\login\controller\Index/logout');
|
14
catchAdmin/login/validate/LoginValidate.php
Normal file
14
catchAdmin/login/validate/LoginValidate.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace catchAdmin\login\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class LoginValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'name|用户名' => 'require|max:25',
|
||||
'password|密码' => 'require',
|
||||
'captcha|验证码' => 'require|captcha'
|
||||
];
|
||||
}
|
117
catchAdmin/login/view/index.html
Normal file
117
catchAdmin/login/view/index.html
Normal file
@@ -0,0 +1,117 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>登录</title>
|
||||
<link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css"/>
|
||||
<link rel="stylesheet" href="/static/assets/css/login.css?v=315">
|
||||
<link rel="stylesheet" href="/static/assets/module/admin.css?v=315">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
if (window != top) {
|
||||
top.location.replace(location.href);
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.captcha {
|
||||
width: 114px;
|
||||
height: 38px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-wrapper">
|
||||
<div class="login-header">
|
||||
<img src="/static/assets/images/logo.png"> EasyWeb后台开发框架
|
||||
</div>
|
||||
<div class="login-body">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<i class="layui-icon layui-icon-engine"></i> 用户登录
|
||||
</div>
|
||||
<form class="layui-card-body layui-form layui-form-pane">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><i class="layui-icon layui-icon-username"></i></label>
|
||||
<div class="layui-input-block">
|
||||
<input name="name" type="text" placeholder="账号" class="layui-input"
|
||||
lay-verType="tips" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><i class="layui-icon layui-icon-password"></i></label>
|
||||
<div class="layui-input-block">
|
||||
<input name="password" type="password" placeholder="密码" class="layui-input"
|
||||
lay-verType="tips" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><i class="layui-icon layui-icon-vercode"></i></label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-row inline-block">
|
||||
<div class="layui-col-xs7">
|
||||
<input name="captcha" type="text" placeholder="验证码" class="layui-input"
|
||||
autocomplete="off" lay-verType="tips" lay-verify="required" required/>
|
||||
</div>
|
||||
<div class="layui-col-xs5" style="padding-left: 6px;">
|
||||
<img src="{:captcha_src()}" alt="captcha" class="captcha" onclick="this.src = this.src + '?t=' + (new Date).getTime();"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<!--<a href="javascript:;" class="layui-link">帐号注册</a>-->
|
||||
<!--<a href="javascript:;" class="layui-link pull-right">忘记密码?</a>-->
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button lay-filter="login-submit" class="layui-btn layui-btn-fluid" lay-submit>登 录</button>
|
||||
</div>
|
||||
<!--<div class="layui-form-item login-other">
|
||||
<label>第三方登录</label>
|
||||
<a href="javascript:;"><i class="layui-icon layui-icon-login-qq"></i></a>
|
||||
<a href="javascript:;"><i class="layui-icon layui-icon-login-wechat"></i></a>
|
||||
<a href="javascript:;"><i class="layui-icon layui-icon-login-weibo"></i></a>
|
||||
</div>-->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-footer">
|
||||
<p>© 2015 ~ {:date('Y', time())} @Lawyer 版权所有</p>
|
||||
<!--<p>
|
||||
<span><a href="https://easyweb.vip" target="_blank">获取授权</a></span>
|
||||
<span><a href="https://easyweb.vip/doc/" target="_blank">开发文档</a></span>
|
||||
<span><a href="https://demo.easyweb.vip/spa/" target="_blank">单页面版</a></span>
|
||||
</p>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- js部分 -->
|
||||
<script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="/static/assets/js/common.js?v=315"></script>
|
||||
<script>
|
||||
layui.use(['layer', 'form'], function () {
|
||||
var $ = layui.jquery;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
|
||||
// 表单提交
|
||||
form.on('submit(login-submit)', function (obj) {
|
||||
$.ajax({
|
||||
url: "{:url('login')}",
|
||||
type: 'post',
|
||||
data: obj.field,
|
||||
success: function(response) {
|
||||
layer.msg(response.msg)
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
13
catchAdmin/permissions/module.json
Normal file
13
catchAdmin/permissions/module.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "权限管理",
|
||||
"alias": "permissions",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"order": 2,
|
||||
"services": [
|
||||
"catchAdmin\\permissions\\PermissionService"
|
||||
],
|
||||
"aliases": {},
|
||||
"files": [],
|
||||
"requires": []
|
||||
}
|
1
catchAdmin/permissions/route.php
Normal file
1
catchAdmin/permissions/route.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
10
catchAdmin/services.php
Normal file
10
catchAdmin/services.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2019-11-29 08:20:23
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
'module\\index\\IndexService' => false,
|
||||
'module\\install\\InstallService' => false,
|
||||
'module\\login\\LoginService' => false,
|
||||
'module\\permissions\\PermissionService' => false,
|
||||
'module\\user\\UserService' => false,
|
||||
);
|
33
catchAdmin/user/controller/Index.php
Normal file
33
catchAdmin/user/controller/Index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace catchAdmin\user\controller;
|
||||
|
||||
use app\BaseController;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function save()
|
||||
{}
|
||||
|
||||
public function read()
|
||||
{}
|
||||
|
||||
public function edit()
|
||||
{}
|
||||
|
||||
public function update()
|
||||
{}
|
||||
|
||||
public function delete()
|
||||
{}
|
||||
|
||||
}
|
44
catchAdmin/user/database/migrations/20191128114204_users.php
Normal file
44
catchAdmin/user/database/migrations/20191128114204_users.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class Users extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('users',array('engine'=>'Innodb'));
|
||||
$table->addColumn('username', 'string',array('limit' => 15,'default'=>'','comment'=>'用户名'))
|
||||
->addColumn('password', 'string',array('limit' => 255,'comment'=>'用户密码'))
|
||||
->addColumn('email', 'string',array('limit' => 100, 'comment'=>'邮箱 登录'))
|
||||
->addColumn('status', 'boolean',array('limit' => 1,'default'=> 1,'comment'=>'用户状态 1 正常 2 禁用'))
|
||||
->addColumn('last_login_ip', 'integer',array('limit' => 11,'default'=>0,'comment'=>'最后登录IP'))
|
||||
->addColumn('last_login_time', 'integer',array('default'=>0,'comment'=>'最后登录时间', 'unsigned' => true))
|
||||
->addColumn('created_at', 'integer',array('default'=>0,'comment'=>'创建时间', 'unsigned' => true))
|
||||
->addColumn('updated_at', 'integer',array('default'=>0,'comment'=>'更新时间', 'unsigned' => true))
|
||||
->addColumn('delete_at', 'boolean',array('limit' => 1,'default'=>0,'comment'=>'删除状态,0未删除 >0 已删除', 'unsigned' => true))
|
||||
->addIndex(array('email'), array('unique' => true))
|
||||
->create();
|
||||
}
|
||||
}
|
19
catchAdmin/user/database/seeds/Abc.php
Normal file
19
catchAdmin/user/database/seeds/Abc.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class Abc extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run Method.
|
||||
*
|
||||
* Write your database seeder using this method.
|
||||
*
|
||||
* More information on writing seeders is available here:
|
||||
* http://docs.phinx.org/en/latest/seeding.html
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
catchAdmin/user/module.json
Normal file
13
catchAdmin/user/module.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "用户管理",
|
||||
"alias": "user",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"order": 2,
|
||||
"services": [
|
||||
"catchAdmin\\user\\UserService"
|
||||
],
|
||||
"aliases": {},
|
||||
"files": [],
|
||||
"requires": []
|
||||
}
|
3
catchAdmin/user/route.php
Normal file
3
catchAdmin/user/route.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$router->resource('user', '\catchAdmin\user\controller\Index');
|
10
catchAdmin/user/view/create.html
Normal file
10
catchAdmin/user/view/create.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
10
catchAdmin/user/view/edit.html
Normal file
10
catchAdmin/user/view/edit.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
10
catchAdmin/user/view/index.html
Normal file
10
catchAdmin/user/view/index.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user