mirror of https://gitee.com/karson/fastadmin.git
一键清除Log日志、优化Crud、自动插入admin_id字段
parent
1731cdd4bf
commit
3c38e83401
|
|
@ -763,7 +763,7 @@ class Crud extends Command
|
|||
'relationMethodList' => '',
|
||||
'controllerIndex' => '',
|
||||
'visibleFieldList' => $fields ? "\$row->visible(['" . implode("','", array_filter(explode(',', $fields))) . "']);" : '',
|
||||
'appendAttrList' => implode(",\n", $appendAttrList) . ',',
|
||||
'appendAttrList' => implode(",\n", $appendAttrList),
|
||||
'getEnumList' => implode("\n\n", $getEnumArr),
|
||||
'getAttrList' => implode("\n\n", $getAttrArr),
|
||||
'setAttrList' => implode("\n\n", $setAttrArr),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<form id="add-form" role="form" data-toggle="validator" method="POST" action="">
|
||||
{%addList%}
|
||||
<div class="form-group layer-footer text-center">
|
||||
<div class="form-group layer-footer">
|
||||
<div class="pp_container text-center">
|
||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
|
|
|
|||
|
|
@ -215,16 +215,24 @@ class Ajax extends Backend
|
|||
case 'content' || 'all':
|
||||
rmdirs(CACHE_PATH, false);
|
||||
Cache::clear();
|
||||
if ($type == 'content')
|
||||
if ($type == 'content') {
|
||||
break;
|
||||
}
|
||||
case 'template' || 'all':
|
||||
rmdirs(TEMP_PATH, false);
|
||||
if ($type == 'template')
|
||||
if ($type == 'template') {
|
||||
break;
|
||||
}
|
||||
case 'log' || 'all':
|
||||
rmdirs(LOG_PATH, false);
|
||||
if ($type == 'log') {
|
||||
break;
|
||||
}
|
||||
case 'addons' || 'all':
|
||||
Service::refresh();
|
||||
if ($type == 'addons')
|
||||
if ($type == 'addons') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
\think\Hook::listen("wipecache_after");
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Url' => '物理路径',
|
||||
'Imagewidth' => '宽度',
|
||||
'Imageheight' => '宽度',
|
||||
'Imagetype' => '图片类型',
|
||||
'Imageframes' => '图片帧数',
|
||||
'Preview' => '预览',
|
||||
'Filesize' => '文件大小',
|
||||
'Mimetype' => 'Mime类型',
|
||||
'Extparam' => '透传数据',
|
||||
'Createtime' => '创建日期',
|
||||
'Uploadtime' => '上传时间',
|
||||
'Storage' => '存储引擎',
|
||||
'Upload to third' => '上传到第三方',
|
||||
'Upload to local' => '上传到本地',
|
||||
'Upload from editor' => '从编辑器上传'
|
||||
'Url' => '物理路径',
|
||||
'Imagewidth' => '宽度',
|
||||
'Imageheight' => '宽度',
|
||||
'Imagetype' => '图片类型',
|
||||
'Imageframes' => '图片帧数',
|
||||
'Preview' => '预览',
|
||||
'Filesize' => '文件大小',
|
||||
'Mimetype' => 'Mime类型',
|
||||
'Extparam' => '透传数据',
|
||||
'Createtime' => '创建日期',
|
||||
'Uploadtime' => '上传时间',
|
||||
'Storage' => '存储引擎',
|
||||
'Upload to third' => '上传到第三方',
|
||||
'Upload to local' => '上传到本地',
|
||||
'Upload from editor' => '从编辑器上传',
|
||||
'No file upload or server upload limit exceeded' => '未上传文件或超出服务器上传限制',
|
||||
'Uploaded file format is limited' => '上传文件格式受限制',
|
||||
'Upload successful' => '上传成功',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\admin\library\traits;
|
||||
|
||||
use app\admin\library\Auth;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Xls;
|
||||
|
|
@ -84,6 +85,8 @@ trait Backend
|
|||
$params = $this->request->post("row/a");
|
||||
if ($params)
|
||||
{
|
||||
$auth = Auth::instance();
|
||||
$params['admin_id'] = $auth->isLogin() ? $auth->id : 0;
|
||||
if ($this->dataLimit && $this->dataLimitFieldAutoFill)
|
||||
{
|
||||
$params[$this->dataLimitField] = $this->auth->id;
|
||||
|
|
|
|||
Loading…
Reference in New Issue