修改BUG:使用最新的bootstrap-input组件,移除class=file,避免组件默认初始化
This commit is contained in:
parent
9e84f9eabd
commit
368f6b2ce9
|
@ -55,7 +55,7 @@ namespace Bootstrap.Admin.Controllers.Api
|
||||||
fileName = Path.Combine(env.WebRootPath, $"images\\uploader\\{fileName}");
|
fileName = Path.Combine(env.WebRootPath, $"images\\uploader\\{fileName}");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
System.IO.File.Delete(fileName);
|
if (System.IO.File.Exists(fileName)) System.IO.File.Delete(fileName);
|
||||||
fileName = "default.jpg";
|
fileName = "default.jpg";
|
||||||
UserHelper.SaveUserIconByName(userName, fileName);
|
UserHelper.SaveUserIconByName(userName, fileName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form enctype="multipart/form-data" class="d-none" data-admin="@User.IsInRole("Administrators")">
|
<form enctype="multipart/form-data" class="d-none" data-admin="@User.IsInRole("Administrators")">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input id="fileIcon" class="file" type="file" data-init="@Model.Size" data-file="@Model.FileName">
|
<input id="fileIcon" type="file" data-init="@Model.Size" data-file="@Model.FileName">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<img class="card-img d-none" src="@Url.Content(Model.Icon)" />
|
<img class="card-img d-none" src="@Url.Content(Model.Icon)" />
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
],
|
],
|
||||||
initialPreviewAsData: true,
|
initialPreviewAsData: true,
|
||||||
overwriteInitial: true,
|
overwriteInitial: true,
|
||||||
dropZoneTitle: "请选择头像"
|
dropZoneTitle: "请选择头像",
|
||||||
|
msgPlaceholder: "请选择头像",
|
||||||
|
fileActionSettings: { showUpload: false }
|
||||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||||
var url = data.response.initialPreview[0];
|
var url = data.response.initialPreview[0];
|
||||||
if (!!url === true) $headerIcon.attr('src', url);
|
if (!!url === true) $headerIcon.attr('src', url);
|
||||||
|
|
Loading…
Reference in New Issue