更新前端文件

This commit is contained in:
2019-07-03 16:36:05 +08:00
parent 073a4de647
commit 777b452685
151 changed files with 158954 additions and 64 deletions

View File

@@ -16,6 +16,5 @@ class Action extends Admin{
* @title 系统首页
*/
public function index(){
}
}

View File

@@ -18,4 +18,11 @@ class Addons extends Admin{
public function index(){
}
/**
* @title 钩子列表
*/
public function hooks(){
}
}

View File

@@ -9,13 +9,73 @@
namespace app\controller\admin;
use app\controller\Admin;
use think\facade\Db;
use app\model\Client as ClientModel;
class Client extends Admin{
/**
* @title 系统首页
*/
public function index(){
public function index(ClientModel $client){
$res = $client->paginate(25, false, array(
'query' => $this->request->param()
));
$data = $res->toArray();
$data['page'] = $res->render();
$this->data = $data;
return $this->data;
}
/**
* @title 添加客户端
*/
public function add(ClientModel $client){
if ($this->request->isPost()) {
$data = $this->request->param();
$result = $client->validate(true)->save($data);
if (false !== $result) {
return $this->success('成功添加', url('client/index'));
}else{
return $this->error($this->model->getError());
}
}else{
$info['appid'] = rand_string(10, 1); //八位数字appid
$info['appsecret'] = rand_string(32); //32位数字加字母秘钥
$data = array(
'info' => $info
);
return $this->data;
}
}
/**
* @title 编辑客户端
*/
public function edit(ClientModel $client){
if ($this->request->isPost()) {
$data = $this->request->param();
$result = $client->validate(true)->save($data, array('id'=>$request->param('id')));
if (false !== $result) {
return $this->success('修改添加', url('client/index'));
}else{
return $this->error($this->model->getError());
}
}else{
$info = $client->where('id', $this->request->param('id'))->find();
$data = array(
'info' => $info
);
return $this->data;
}
}
/**
* @title 删除客户端
*/
public function del(ClientModel $client){
}
}