This commit is contained in:
WispX
2018-10-22 22:33:36 +08:00
parent 6ee6b017ec
commit ec3e4e3a79
3 changed files with 10 additions and 1 deletions
+7
View File
@@ -14,6 +14,8 @@ class Images extends Model
{
protected $updateTime = false;
protected $insert = ['ip'];
public function getUrlAttr($url, $data)
{
// 图片链接
@@ -24,4 +26,9 @@ class Images extends Model
$domain = $cdnDoamin ? $cdnDoamin : request()->domain();
return make_url($domain, $data['pathname']);
}
public function setIpAttr()
{
return request()->ip();
}
}
@@ -35,6 +35,7 @@
<th>路径</th>
<th>大小</th>
<th>类型</th>
<th>上传IP</th>
<th>上传时间</th>
<th>操作</th>
</tr>
@@ -47,6 +48,7 @@
<td>{$value.pathname}</td>
<td class="mdui-text-color-light-blue">{$value.size|format_size}</td>
<td>{$value.mime}</td>
<td>{$value.ip}</td>
<td>{$value.create_time}</td>
<td>
<img class="none" data-original="{$value.url}" src="{$value.url}">
+1 -1
View File
@@ -81,7 +81,6 @@ INSERT INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `
(40, 'upyun', 'text', 'text', 'upyun_service_name', 'ServiceName', '云储存服务名称', '', ''),
(41, '', 'text', 'text', 'system_version', '系统版本', NULL, '1.0', '');
-- --------------------------------------------------------
--
@@ -100,6 +99,7 @@ CREATE TABLE IF NOT EXISTS `lsky_images` (
`mime` varchar(32) NOT NULL COMMENT '文件MIME类型',
`sha1` varchar(100) NOT NULL COMMENT 'hash sha1',
`md5` varchar(32) NOT NULL COMMENT 'hash md5',
`ip` varchar(128) DEFAULT NULL COMMENT '上传者IP',
`create_time` int(11) NOT NULL COMMENT '创建时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='图片表';