new files
This commit is contained in:
63
pro_v3.5.1/app/controller/admin/v1/system/log/Clear.php
Normal file
63
pro_v3.5.1/app/controller/admin/v1/system/log/Clear.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\system\log;
|
||||
|
||||
use think\exception\ValidateException;
|
||||
use app\services\system\log\ClearServices;
|
||||
use app\controller\admin\AuthController;
|
||||
|
||||
/**
|
||||
* 清除数据控制器
|
||||
* Class Clear
|
||||
* @package app\controller\admin\v1\system
|
||||
*/
|
||||
class Clear extends AuthController
|
||||
{
|
||||
/**
|
||||
* @var ClearServices
|
||||
*/
|
||||
protected ClearServices $services;
|
||||
|
||||
/**
|
||||
* Clear constructor.
|
||||
* @param ClearServices $services
|
||||
*/
|
||||
public function __construct(ClearServices $services)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->services = $services;
|
||||
//生产模式下不允许清除数据
|
||||
if (!env('APP_DEBUG', false)) {
|
||||
throw new ValidateException('生产模式下,禁止操作');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新数据缓存
|
||||
*/
|
||||
public function refresh_cache()
|
||||
{
|
||||
$this->services->refresCache();
|
||||
return $this->success('数据缓存刷新成功!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除日志
|
||||
*/
|
||||
public function delete_log()
|
||||
{
|
||||
$this->services->deleteLog();
|
||||
return $this->success('数据缓存刷新成功!');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
89
pro_v3.5.1/app/controller/admin/v1/system/log/SystemFile.php
Normal file
89
pro_v3.5.1/app/controller/admin/v1/system/log/SystemFile.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\system\log;
|
||||
|
||||
use think\annotation\Inject;
|
||||
use think\exception\ValidateException;
|
||||
use app\controller\admin\AuthController;
|
||||
use app\services\system\log\SystemFileServices;
|
||||
|
||||
/**
|
||||
* 文件校验控制器
|
||||
* Class SystemFile
|
||||
* @package app\admin\controller\system
|
||||
*
|
||||
*/
|
||||
class SystemFile extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var SystemFileServices
|
||||
*/
|
||||
#[Inject]
|
||||
protected SystemFileServices $services;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* SystemFile constructor.
|
||||
* @param SystemFileServices $services
|
||||
*/
|
||||
public function __construct(SystemFileServices $services)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->services = $services;
|
||||
//生产模式下不允许清除数据
|
||||
if (!env('APP_DEBUG', false)) {
|
||||
throw new ValidateException('生产模式下,禁止操作');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件校验记录
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return $this->success(['list' => $this->services->getFileList()]);
|
||||
}
|
||||
|
||||
//打开目录
|
||||
public function opendir()
|
||||
{
|
||||
// return $this->success($this->services->opendir());
|
||||
}
|
||||
|
||||
//读取文件
|
||||
public function openfile()
|
||||
{
|
||||
// $file = $this->request->param('filepath');
|
||||
// if (empty($file)) return $this->fail('出现错误');
|
||||
// return $this->success($this->services->openfile($file));
|
||||
}
|
||||
|
||||
//保存文件
|
||||
public function savefile()
|
||||
{
|
||||
// $comment = $this->request->param('comment');
|
||||
// $filepath = $this->request->param('filepath');
|
||||
// if(empty($comment) || empty($filepath)){
|
||||
// return $this->fail('出现错误');
|
||||
// }
|
||||
// $res = $this->services->savefile($filepath,$comment);
|
||||
// if ($res) {
|
||||
return $this->success('保存成功!');
|
||||
// } else {
|
||||
// return $this->fail('保存失败');
|
||||
// }
|
||||
}
|
||||
}
|
||||
66
pro_v3.5.1/app/controller/admin/v1/system/log/SystemLog.php
Normal file
66
pro_v3.5.1/app/controller/admin/v1/system/log/SystemLog.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\system\log;
|
||||
|
||||
use app\services\system\admin\SystemAdminServices;
|
||||
use app\controller\admin\AuthController;
|
||||
use app\services\system\log\SystemLogServices;
|
||||
|
||||
/**
|
||||
* 管理员操作记录表控制器
|
||||
* Class SystemLog
|
||||
* @package app\controller\admin\v1\system
|
||||
*/
|
||||
class SystemLog extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var SystemLogServices
|
||||
*/
|
||||
protected SystemLogServices $services;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* SystemLog constructor.
|
||||
* @param SystemLogServices $services
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct(SystemLogServices $services)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->services = $services;
|
||||
$this->services->deleteLog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示操作记录
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$where = $this->request->getMore([
|
||||
['pages', ''],
|
||||
['path', ''],
|
||||
['ip', ''],
|
||||
['admin_id', ''],
|
||||
['data', '', '', 'time'],
|
||||
]);
|
||||
return $this->success($this->services->getLogList($where, (int)$this->adminInfo['level']));
|
||||
}
|
||||
|
||||
public function search_admin(SystemAdminServices $services)
|
||||
{
|
||||
$info = $services->getOrdAdmin('id,real_name', $this->adminInfo['level']);
|
||||
return $this->success(compact('info'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user