diff --git a/application/common/controller/Base.php b/application/common/controller/Base.php
index de56e575..da496bb3 100644
--- a/application/common/controller/Base.php
+++ b/application/common/controller/Base.php
@@ -16,7 +16,7 @@ class Base extends Controller
public function _empty()
{
- $this->redirect('error/index/index');
+ $this->redirect(url('/notfound'));
}
}
diff --git a/application/common/controller/index b/application/common/controller/index
new file mode 100644
index 00000000..e69de29b
diff --git a/application/error/controller/Index.php b/application/error/controller/Index.php
index 5dcb93d8..e3128a32 100644
--- a/application/error/controller/Index.php
+++ b/application/error/controller/Index.php
@@ -15,7 +15,7 @@ class Index extends Controller
public function index()
{
//
- dump('空方法转到这里');
+ return $this->fetch();
}
diff --git a/application/error/view/index/index.html b/application/error/view/index/index.html
new file mode 100644
index 00000000..f5b504a8
--- /dev/null
+++ b/application/error/view/index/index.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+ 404
+
+ 不好意思,您访问的页面不存在~
+ 您可以:
+ < 返回上一页
+ |
+ 去首页 >
+
+
+
+
\ No newline at end of file
diff --git a/application/http/middleware/YanZheng.php b/application/http/middleware/YanZheng.php
index ad9a7808..a8352088 100644
--- a/application/http/middleware/YanZheng.php
+++ b/application/http/middleware/YanZheng.php
@@ -12,16 +12,13 @@ class YanZheng extends Controller
// 实例化权限验证类
$auth = new Auth();
- // 检测权限
- // if($auth->check('show_button',1)){// 第一个参数是规则名称,第二个参数是用户UID
- // //有显示操作按钮的权限
- // }else{
- // //没有显示操作按钮的权限
- // }
-
- $request->hello = 'ThinkPHP';
- $a = $request->action();
+ if($auth->check('show_button',1)){// 第一个参数是规则名称,第二个参数是用户UID
+ dump('验证通过');
+ }else{
+ dump('验证不通过');
+ }
+
return $next($request);
}
diff --git a/application/index/controller/Error.php b/application/index/controller/Error.php
new file mode 100644
index 00000000..857c48f5
--- /dev/null
+++ b/application/index/controller/Error.php
@@ -0,0 +1,21 @@
+redirect(url('/notfound'));
+ }
+
+}
diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php
index 93a05834..7b251293 100644
--- a/application/index/controller/Index.php
+++ b/application/index/controller/Index.php
@@ -6,7 +6,6 @@ use app\common\controller\Base;
// 引用与此控制器同名的数据模型
use app\system\model\SystemBase as sysbasemod;
-use think\auth\Auth;
class Index extends Base
{
@@ -27,7 +26,6 @@ class Index extends Base
$sysbasemod->title = '学生成绩统计系统';
$sysbasemod->save();
}
- dump('index初始化');
}
diff --git a/application/student/controller/Error.php b/application/student/controller/Error.php
new file mode 100644
index 00000000..74eb2b0a
--- /dev/null
+++ b/application/student/controller/Error.php
@@ -0,0 +1,14 @@
+redirect(url('/notfound'));
+ }
+}
diff --git a/application/system/controller/Error.php b/application/system/controller/Error.php
new file mode 100644
index 00000000..d62455c6
--- /dev/null
+++ b/application/system/controller/Error.php
@@ -0,0 +1,14 @@
+redirect(url('/notfound'));
+ }
+}
diff --git a/config/auth/app.php b/config/auth/app.php
deleted file mode 100644
index b58470cf..00000000
--- a/config/auth/app.php
+++ /dev/null
@@ -1,13 +0,0 @@
- [
- 'auth_on' => 1, // 权限开关
- 'auth_type' => 1, // 认证方式,1为实时认证;2为登录认证。
- 'auth_group' => 'auth_group', // 用户组数据不带前缀表名
- 'auth_group_access' => 'auth_group_access', // 用户-用户组关系不带前缀表
- 'auth_rule' => 'auth_rule', // 权限规则不带前缀表
- 'auth_user' => 'member', // 用户信息不带前缀表
- ],
-];
\ No newline at end of file
diff --git a/config/index/app.php b/config/index/app.php
index f7413ded..eb6a7e2b 100644
--- a/config/index/app.php
+++ b/config/index/app.php
@@ -5,4 +5,13 @@ return [
'chengji' => [
'version' => '1.0',
],
+ // Auth权限验证公共配置
+ 'auth' => [
+ 'auth_on' => 1, // 权限开关
+ 'auth_type' => 1, // 认证方式,1为实时认证;2为登录认证。
+ 'auth_group' => 'auth_group', // 用户组数据不带前缀表名
+ 'auth_group_access' => 'auth_group_access', // 用户-用户组关系不带前缀表
+ 'auth_rule' => 'auth_rule', // 权限规则不带前缀表
+ 'auth_user' => 'member', // 用户信息不带前缀表
+ ],
];
\ No newline at end of file
diff --git a/database/migrations/20181012140355_member.php b/database/migrations/20181012140355_member.php
new file mode 100644
index 00000000..bd7c259f
--- /dev/null
+++ b/database/migrations/20181012140355_member.php
@@ -0,0 +1,50 @@
+table('member');
+
+ // 添加当前表字段
+ $table
+ ->addColumn('xingming','string',['limit'=>15,'null'=>false,'comment'=>'用户姓名'])
+ ->addColumn('xingbie','boolean',['limit'=>1,'default'=>'2','null'=>false,'comment'=>'0=女,1=男,2=未知'])
+ ->addColumn('shengri','integer',['limit'=>11,'null'=>true,'comment'=>'出生日期'])
+ ->addColumn('username','string',['limit'=>18,'null'=>false,'comment'=>'用户帐号'])
+ ->addColumn('password','string',['limit'=>128,'null'=>false,'comment'=>'登录密码'])
+ ->addColumn('denglucishu','integer',['limit'=>5,'default'=>0,'null'=>false,'comment'=>'登录次数'])
+ ->addColumn('ip','string',['limit'=>55,'default'=>'127.0.0.1','null'=>false,'comment'=>'登录IP'])
+ ->addColumn('lasttime','integer',['limit'=>11,'null'=>false,'comment'=>'最后登录时间'])
+ ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常'])
+ ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间'])
+ ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间'])
+ ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间'])
+ ->create();
+ }
+}
diff --git a/route/error.php b/route/error.php
new file mode 100644
index 00000000..8823b061
--- /dev/null
+++ b/route/error.php
@@ -0,0 +1,14 @@
+
+// +----------------------------------------------------------------------
+
+// 错误页面
+// 找不到操作提示
+Route::rule('notfound','error/index/index');
diff --git a/vendor/5ini99/think-auth/src/Auth.php b/vendor/5ini99/think-auth/src/Auth.php
index ab31e083..5377b6db 100644
--- a/vendor/5ini99/think-auth/src/Auth.php
+++ b/vendor/5ini99/think-auth/src/Auth.php
@@ -11,9 +11,9 @@
namespace think\auth;
use think\Db;
-use think\Config;
-use think\Session;
-use think\Request;
+use think\facade\Config;
+use think\facade\Session;
+use think\facade\Request;
use think\Loader;
/**
@@ -101,11 +101,11 @@ class Auth
public function __construct()
{
//可设置配置项 auth, 此配置项为数组。
- // if ($auth = Config::get('auth')) {
- // $this->config = array_merge($this->config, $auth);
- // }
- // // 初始化request
- // $this->request = Request::instance();
+ if ($auth = Config::get('auth')) {
+ $this->config = array_merge($this->config, $auth);
+ }
+ // 初始化request
+ $this->request = Request::instance();
}
/**