diff --git a/Bootstrap.Admin/Controllers/Api/ProfilesController.cs b/Bootstrap.Admin/Controllers/Api/ProfilesController.cs index 09e53b19..dc460a4c 100644 --- a/Bootstrap.Admin/Controllers/Api/ProfilesController.cs +++ b/Bootstrap.Admin/Controllers/Api/ProfilesController.cs @@ -55,7 +55,7 @@ namespace Bootstrap.Admin.Controllers.Api fileName = Path.Combine(env.WebRootPath, $"images\\uploader\\{fileName}"); try { - System.IO.File.Delete(fileName); + if (System.IO.File.Exists(fileName)) System.IO.File.Delete(fileName); fileName = "default.jpg"; UserHelper.SaveUserIconByName(userName, fileName); } diff --git a/Bootstrap.Admin/Views/Admin/Profiles.cshtml b/Bootstrap.Admin/Views/Admin/Profiles.cshtml index 13a15689..52a69081 100644 --- a/Bootstrap.Admin/Views/Admin/Profiles.cshtml +++ b/Bootstrap.Admin/Views/Admin/Profiles.cshtml @@ -101,7 +101,7 @@
- +
diff --git a/Bootstrap.Admin/wwwroot/js/profiles.js b/Bootstrap.Admin/wwwroot/js/profiles.js index 3ff7edaf..1dba29b3 100644 --- a/Bootstrap.Admin/wwwroot/js/profiles.js +++ b/Bootstrap.Admin/wwwroot/js/profiles.js @@ -19,7 +19,9 @@ ], initialPreviewAsData: true, overwriteInitial: true, - dropZoneTitle: "请选择头像" + dropZoneTitle: "请选择头像", + msgPlaceholder: "请选择头像", + fileActionSettings: { showUpload: false } }).on('fileuploaded', function (event, data, previewId, index) { var url = data.response.initialPreview[0]; if (!!url === true) $headerIcon.attr('src', url);