fix:修复部分日志记录没有标题的问题

This commit is contained in:
妙码生花 2022-06-16 20:06:27 +08:00
parent 7b29dbc53b
commit 81e7f53321
8 changed files with 53 additions and 3 deletions

View File

@ -303,6 +303,7 @@ INSERT INTO `__PREFIX__menu_rule` VALUES ('73', '71', 'button', '添加', 'secur
INSERT INTO `__PREFIX__menu_rule` VALUES ('74', '71', 'button', '编辑', 'security/sensitiveData/edit', '', '', null, '', '', '0', 'none', '', '81', '1', '1648065864', '1647806129');
INSERT INTO `__PREFIX__menu_rule` VALUES ('75', '71', 'button', '删除', 'security/sensitiveData/del', '', '', null, '', '', '0', 'none', '', '81', '1', '1648065864', '1647806112');
INSERT INTO `__PREFIX__menu_rule` VALUES ('76', '0', 'menu', 'BuildAdmin', 'buildadmin/buildadmin', 'buildadmin', 'local-logo', 'link', 'https://doc.buildadmin.com', '', '0', 'none', '', '0', '0', '1651926977', '1648947396');
INSERT INTO `__PREFIX__menu_rule` VALUES ('77', '45', 'button', '添加', 'routine/config/add', '', '', null, '', '', '0', 'none', '', '88', '1', '1655375826', '1655375812');
COMMIT;
-- ----------------------------

View File

@ -8,6 +8,7 @@ use think\exception\FileException;
use app\common\library\Upload;
use app\common\controller\Backend;
use think\facade\Db;
use app\admin\model\AdminLog;
class Ajax extends Backend
{
@ -20,6 +21,7 @@ class Ajax extends Backend
public function upload()
{
AdminLog::setTitle(__('upload'));
$file = $this->request->file('file');
try {
$upload = new Upload($file);
@ -58,6 +60,7 @@ class Ajax extends Backend
public function changeTerminalConfig()
{
AdminLog::setTitle(__('changeTerminalConfig'));
if (CommandExec::instance(false)->changeTerminalConfig()) {
$this->success('');
} else {

View File

@ -34,13 +34,13 @@ class Config extends Backend
$list[$item['key']]['name'] = $item['key'];
$list[$item['key']]['title'] = __($item['value']);
$newConfigGroup[$item['key']] = $item['value'];
$newConfigGroup[$item['key']] = $list[$item['key']]['title'];
}
$this->success('', [
'list' => $list,
'remark' => get_route_remark(),
'configGroup' => $newConfigGroup,
'configGroup' => $newConfigGroup ?? [],
'quickEntrance' => get_sys_config('config_quick_entrance'),
]);
}

View File

@ -2,4 +2,6 @@
return [
'Failed to switch package manager. Please modify the configuration file manually:%s' => 'Failed to switch package manager. Please modify the configuration file manually:%s',
'Failed to modify the terminal configuration. Please modify the configuration file manually:%s' => 'Failed to modify the terminal configuration. Please modify the configuration file manually:%s',
'upload' => 'Upload',
'changeTerminalConfig' => 'change Terminal Config',
];

View File

@ -2,4 +2,6 @@
return [
'Failed to switch package manager. Please modify the configuration file manually:%s' => '包管理器切换失败,请手动修改配置文件:%s',
'Failed to modify the terminal configuration. Please modify the configuration file manually:%s' => '修改终端配置失败,请手动修改配置文件:%s',
'upload' => '上传文件',
'changeTerminalConfig' => '修改终端配置',
];

View File

@ -15,4 +15,5 @@ return [
'smtp pass' => 'SMTP 密码',
'smtp verification' => 'SMTP 验证方式',
'smtp sender mail' => 'SMTP 发件人邮箱',
'Variable name' => '变量名',
];

View File

@ -0,0 +1,41 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Config extends Validate
{
protected $failException = true;
protected $rule = [
'name' => 'require|unique:config',
];
/**
* 验证提示信息
* @var array
*/
protected $message = [];
/**
* 字段描述
*/
protected $field = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => ['name'],
];
public function __construct()
{
$this->field = [
'name' => __('Variable name'),
];
parent::__construct();
}
}

View File

@ -5,7 +5,7 @@
return [
// 上传Url
'url' => 'api/common/upload',
'url' => 'api/ajax/upload',
// cdn地址
'cdn' => '',
// 文件保存格式化方法