diff --git a/application/admin/model/Admin.php b/application/admin/model/Admin.php
index f021d2e0..b1847bb9 100644
--- a/application/admin/model/Admin.php
+++ b/application/admin/model/Admin.php
@@ -7,6 +7,13 @@ use app\common\model\Base;
class Admin extends Base
{
+ // 用户角色获取器
+ public function userGroup()
+ {
+ return $this->belongsToMany('AuthGroup','AuthGroupAccess','id','uid');
+ }
+
+
// 获取密码
public function password($username)
{
diff --git a/application/admin/model/AuthGroupAccess.php b/application/admin/model/AuthGroupAccess.php
index 7edba059..b8cede76 100644
--- a/application/admin/model/AuthGroupAccess.php
+++ b/application/admin/model/AuthGroupAccess.php
@@ -3,9 +3,9 @@
namespace app\admin\model;
// 引用用户数据模型
-use app\common\model\Base;
+use think\model\Pivot;
-class AuthGroupAccess extends Base
+class AuthGroupAccess extends Pivot
{
//
}
diff --git a/application/common/view/create.html b/application/common/view/create.html
index dd1199ff..aff1cbe9 100644
--- a/application/common/view/create.html
+++ b/application/common/view/create.html
@@ -1,84 +1,28 @@
-
-
-
-
-
-
+
diff --git a/application/index/view/index/welcome.html b/application/index/view/index/welcome.html
index 4ade43a8..3fed3dc8 100644
--- a/application/index/view/index/welcome.html
+++ b/application/index/view/index/welcome.html
@@ -2,7 +2,7 @@
-
{$list.webtitle}
+
{php}echo session('webtitle'){/php}
diff --git a/application/login/controller/Index.php b/application/login/controller/Index.php
index c2634def..a3cef54a 100644
--- a/application/login/controller/Index.php
+++ b/application/login/controller/Index.php
@@ -9,6 +9,8 @@ use app\admin\model\Admin as AD;
use WhiteHat101\Crypt\APR1_MD5;
// 引用Session类
use \think\facade\Session;
+// 引用验证码类
+use think\captcha\Captcha;
class Index extends Controller
@@ -21,15 +23,7 @@ class Index extends Controller
// 清除session(当前作用域)
session(null);
- //实例化数据模型
- $sysbasemod = new \app\system\model\SystemBase;
-
- // 查询系统信息
- $list['webtitle'] = $sysbasemod
- ->order(['id'=>'desc'])
- ->limit(1)
- ->value('webtitle');
-
+ // 获取系统版本号
$list['version'] = config('app.chengji.version');
$this->assign('list',$list);
@@ -48,22 +42,16 @@ class Index extends Controller
// 获取表单数据
- $data = request()->only(['username','password']);
+ $data = request()->only(['username','password','captcha']);
// 验证表单数据
$result = $validate->check($data);
- $msg = $validate->getError();
if(!$result){
- $this->error($msg);
+ $data=['msg'=>$validate->getError(),'status'=>0];
+ return json($data);
}
- // if(!captcha_check($data['captcha']))
- // {
- // $this->error('验证码错误');
- // }
-
-
// 验证用户名和密码
$check = $this->check($data['username'],$data['password']);
@@ -132,5 +120,14 @@ class Index extends Controller
}
return $check;
}
-
+
+ // 生成验证码
+ public function verify()
+ {
+ $captcha = new Captcha();
+ $captcha->fontSize = 30;
+ $captcha->length = 6;
+ $captcha->codeSet = '0123456789';
+ return $captcha->entry();
+ }
}
diff --git a/application/login/validate/Yanzheng.php b/application/login/validate/Yanzheng.php
index a5e006d4..d9044341 100644
--- a/application/login/validate/Yanzheng.php
+++ b/application/login/validate/Yanzheng.php
@@ -13,12 +13,12 @@ class Yanzheng extends Validate
* @var array
*/
protected $rule = [
- 'username' => 'require',
- 'password' => 'require',
+ 'username|用户名' => 'require',
+ 'password|密码' => 'require',
+ 'captcha|验证码'=>'require|captcha',
];
protected $message = [
- 'username.require' => '用户名必须填写',
- 'password.require' => '密码必须填写',
+
];
}
diff --git a/application/login/view/index/index.html b/application/login/view/index/index.html
index 6fa102e5..1219ba08 100644
--- a/application/login/view/index/index.html
+++ b/application/login/view/index/index.html
@@ -2,7 +2,7 @@
-
{$list['webtitle']} v{$list['version']}
+
小学生成绩管理平台 v{$list['version']}
@@ -26,6 +26,10 @@
+
+
+

+
@@ -35,18 +39,21 @@
$(function () {
layui.use('form', function(){
var form = layui.form;
+
//监听提交
form.on('submit(login)', function(data){
$.post("/login",data.field,function(data,status){
if(status != 'success')
{
layer.msg('数据传输错误');
+ $('#captchaimg').onclick();
}
if(data.status == 1)
{
- window.location.href='/';
+ window.location.href="/";
}else{
layer.msg(data.msg);
+ $('#captchaimg').click();
}
});
return false;
diff --git a/application/system/controller/School.php b/application/system/controller/School.php
index c7b9fa0c..5852af80 100644
--- a/application/system/controller/School.php
+++ b/application/system/controller/School.php
@@ -30,7 +30,7 @@ class School extends Base
// 获取单位列表数据
- public function ajaxData()
+ public function ajaxData1()
{
// 获取DT的传值
$getdt = request()->param();
@@ -84,6 +84,29 @@ class School extends Base
}
+ // 获取单位列表数据
+ public function ajaxData()
+ {
+
+ // 实例化
+ $sch = new sch;
+
+ // 获取荣誉总数
+ $data = $sch->select();
+
+
+ // 重组返回内容
+ $data = [
+ 'code'=> 0 , // ajax请求次数,作为标识符
+ 'msg'=>"", // 获取到的结果数(每页显示数量)
+ 'count'=>100, // 符合条件的总数据量
+ 'data'=>$data, //获取到的数据结果
+ ];
+
+ return json($data);
+ }
+
+
// 添加单位
public function create()
diff --git a/application/system/controller/SystemBase.php b/application/system/controller/SystemBase.php
index b0b50df7..af1994fd 100644
--- a/application/system/controller/SystemBase.php
+++ b/application/system/controller/SystemBase.php
@@ -40,7 +40,7 @@ class SystemBase extends Base
$validate = new \app\system\validate\SystemBase;
// 获取表单数据
- $list = request()->only(['title','keywords','description','thinks','danwei'],'put');;
+ $list = request()->only(['webtitle','keywords','description','thinks','danwei'],'put');;
// 验证表单数据
$result = $validate->check($list);
@@ -55,7 +55,7 @@ class SystemBase extends Base
$data = sysbasemod::where('id',$id)->update($list);
// 根据更新结果设置返回提示信息
- $data>=0 ? $data=['msg'=>'更新成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0];
+ $data>=0 ? $data=['msg'=>'设置成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0];
// 返回信息
return json($data);
diff --git a/application/system/validate/SystemBase.php b/application/system/validate/SystemBase.php
index 72865af9..283a7a5e 100644
--- a/application/system/validate/SystemBase.php
+++ b/application/system/validate/SystemBase.php
@@ -13,7 +13,7 @@ class SystemBase extends Validate
* @var array
*/
protected $rule = [
- 'title|标题' => 'require|length:2,50',
+ 'webtitle|标题' => 'require|length:2,50',
'keywords|关键字' => 'require|length:2,60',
'description|描述' => 'require|length:1,100',
'thinks|感谢' => 'require|length:1,80',
diff --git a/application/system/view/school/index.html b/application/system/view/school/index.html
index 11023dae..b6024cad 100644
--- a/application/system/view/school/index.html
+++ b/application/system/view/school/index.html
@@ -1,171 +1,111 @@
-{extend name="common@list" /}
-{block name="topnav"}
-
-{/block}
-{block name="bouttons"}
-
-
-
-
-
- {php}$category = getCategory(101);{/php}
-
-
-
- {foreach $category as $key=>$vo }
-
- {/foreach}
-
-
-
-
-
-{/block}
-{block name="tables"}
-
+
+
+
+
+
+
{$list.title}
+
+
+
+ {load href="__STATIC__/xadmin/css/font.css" /}
+ {load href="__STATIC__/xadmin/css/xadmin.css" /}
+ {load href="__STATIC__/xadmin/js/jquery.min.js" /}
+ {load href="__STATIC__/xadmin/lib/layui/layui.js" /}
+ {load href="__STATIC__/xadmin/js/xadmin.js" /}
+ {load href="__STATIC__/xadmin/js/cookie.js" /}
+
+
+
+
+
+
+
+
+
+
+
-{/block}
\ No newline at end of file
+
+
+
+
+
+
+ });
+
+
+
\ No newline at end of file
diff --git a/application/system/view/system_base/index.html b/application/system/view/system_base/index.html
index 25cd4801..32176faa 100644
--- a/application/system/view/system_base/index.html
+++ b/application/system/view/system_base/index.html
@@ -1,75 +1,49 @@
-
-
-
-
-
-
{$list.webtitle}
-
-
-
- {load href="__STATIC__/xadmin/css/font.css" /}
- {load href="__STATIC__/xadmin/css/xadmin.css" /}
- {load href="__STATIC__/xadmin/js/jquery.min.js" /}
- {load href="__STATIC__/xadmin/lib/layui/layui.js" /}
- {load href="__STATIC__/xadmin/js/xadmin.js" /}
- {load href="__STATIC__/xadmin/js/cookie.js" /}
-
-
-
-
-
+{/block}
+
+{block name="myjs"}
-
-
+{/block}
-
\ No newline at end of file
diff --git a/config/session.php b/config/session.php
index 77e0eabd..194318b2 100644
--- a/config/session.php
+++ b/config/session.php
@@ -24,5 +24,5 @@ return [
// 是否自动开启 SESSION
'auto_start' => true,
// 过期时间
- 'expire' => 600,
+ 'expire' => 60000,
];
diff --git a/public/static/xadmin/member-list1.html b/public/static/xadmin/member-list1.html
index f1be3e34..98672f00 100644
--- a/public/static/xadmin/member-list1.html
+++ b/public/static/xadmin/member-list1.html
@@ -112,6 +112,39 @@
break;
};
});
+
+
+
+
+
+ var table = layui.table;
+
+ //第一个实例
+ table.render({
+ elem: '#demo',
+ height: 312,
+ url: '/demo/table/user/' //数据接口,
+ page: true //开启分页,
+ cols: [[ //表头
+ {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
+ ,{field: 'username', title: '用户名', width:80}
+ ,{field: 'sex', title: '性别', width:80, sort: true}
+ ,{field: 'city', title: '城市', width:80}
+ ,{field: 'sign', title: '签名', width: 177}
+ ,{field: 'experience', title: '积分', width: 80, sort: true}
+ ,{field: 'score', title: '评分', width: 80, sort: true}
+ ,{field: 'classify', title: '职业', width: 80}
+ ,{field: 'wealth', title: '财富', width: 135, sort: true}
+ ]]
+ });
+
+
+
+
+
+
+
+
});