⬆️ Upgrading dependencies.

This commit is contained in:
WispX 2020-01-08 11:08:44 +08:00
parent 53c62f6e9b
commit 4b7d34fc4f
5 changed files with 13 additions and 39 deletions

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
[app]
debug = false
trace = false

View File

@ -209,29 +209,20 @@ class Upload extends Base
$naming = Config::pull('naming');
$pathRule = $this->config['path_naming_rule'];
$fileRule = $this->config['file_naming_rule'];
if ($pathRule === '{input}') {
$path = trim(input('album'), '/');
} elseif ($pathRule === '{input_with_user}') {
$path = trim($this->user->username . '/' . input('album'), '/');
} else {
$path = trim(str_replace(
array_column($naming['path'], 'name'),
array_column($naming['path'], 'value'),
$pathRule
), '/');
}
$path = trim(str_replace(
array_column($naming['path'], 'name'),
array_column($naming['path'], 'value'),
$pathRule
), '/');
if ($fileRule === '{original}') {
$file = $name;
} else {
$file = trim(str_replace(
array_column($naming['file'], 'name'),
array_column($naming['file'], 'value'),
$fileRule
), '/') . '.' . get_file_ext($name);
array_column($naming['file'], 'name'),
array_column($naming['file'], 'value'),
$fileRule
), '/') . '.' . get_file_ext($name);
}
return $path . '/' . $file;
}
}

View File

@ -24,8 +24,6 @@
</div>
<form action="" method="post" enctype="multipart/form-data">
<input id="image" style="display: none;" type="file" multiple name="image" accept="image/*">
<br>
<input id="album" class="input-group form-control" type="text" name="album" placeholder="上传到相册,{input} 模式不可留空,{input_with_user} 模式可留空" tabindex="500">
</form>
<div class="success-info">
<div class="mdui-tab mdui-tab-scrollable" mdui-tab>
@ -102,12 +100,6 @@
//browseClass: "btn btn-file",
maxFileSize: "{$config.upload_max_size / 1024}",// kb
maxFileCount: "{$config.upload_single_num}",
uploadExtraData: function(previewId, index) {
var data = {
album : $('#album').val(),
};
return data;
},
showCaption: true,
dropZoneEnabled: true,
browseIcon: "<i class=\"glyphicon glyphicon-picture\"></i> ",

View File

@ -87,18 +87,6 @@ return [
'explain' => '16位随机字符串',
'value' => str_rand(),
],
[
'name' => '{input}',
'example' => 'life、宠物',
'explain' => '上传到相册名字,上传时由用户输入指定,比如上传时输入 life则会上传到 path-store/life/文件夹下',
'value' => $md5,
],
[
'name' => '{input_with_user}',
'example' => 'life、宠物',
'explain' => '上传到相册名字,上传时由用户输入指定,路径带有当前用户名前缀,比如上传时输入 life则会上传到: path-store/username/life/文件夹下',
'value' => $md5,
],
],
'file' => [
[

View File

@ -7,6 +7,6 @@
*/
return [
// 色情图片是否直接拦截
// 违规图片是否直接拦截
'intercept_salacity' => false,
];