代码更新
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\controller\Admin;
|
||||
use app\model\Config as ConfigModel;
|
||||
|
||||
class Config extends Admin{
|
||||
|
||||
@@ -22,7 +23,21 @@ class Config extends Admin{
|
||||
/**
|
||||
* @title 系统首页
|
||||
*/
|
||||
public function group(){
|
||||
public function group(ConfigModel $config){
|
||||
if ($this->request->isAjax()) {
|
||||
# code...
|
||||
}else{
|
||||
$this->data['id'] = $this->request->param('id', 1);
|
||||
$res = $config->where(array('status' => 1, 'group' => $this->data['id']))->field('id,name,title,extra,value,remark,type')->order('sort')->select();
|
||||
|
||||
$this->data['list'] = $res->toArray();
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 主题设置
|
||||
*/
|
||||
public function themes(){
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,15 @@ use app\controller\Admin;
|
||||
class Database extends Admin{
|
||||
|
||||
/**
|
||||
* @title 系统首页
|
||||
* @title 数据备份
|
||||
*/
|
||||
public function index(){
|
||||
public function export(){
|
||||
|
||||
}
|
||||
/**
|
||||
* @title 数据导入
|
||||
*/
|
||||
public function import(){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -31,11 +31,31 @@ class Index extends Admin{
|
||||
/**
|
||||
* @title 后台登录
|
||||
*/
|
||||
public function login(){
|
||||
public function login(\app\model\Member $member){
|
||||
if ($this->request->isAjax()) {
|
||||
Session::set('user', ['uid'=>1,'username'=>'admin']);
|
||||
$username = $this->request->param('username', '');
|
||||
$password = $this->request->param('password', '');
|
||||
$user = $member->login($username, $password);
|
||||
if ($user) {
|
||||
Session::set('user', $user);
|
||||
$this->data['url'] = "/admin/index/index.html";
|
||||
$this->data['msg'] = "登录成功!";
|
||||
}else{
|
||||
Session::set('user', null);
|
||||
$this->data['code'] = 1;
|
||||
$this->data['msg'] = "登录失败!";
|
||||
}
|
||||
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 后台登出
|
||||
*/
|
||||
public function logout(){
|
||||
Session::set('user', null);
|
||||
$this->data['code'] = 0;
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,11 @@ class Seo extends Admin{
|
||||
public function index(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 重写规则
|
||||
*/
|
||||
public function rewrite(){
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user