diff --git a/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs b/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs index 25f2b6b..4c9ead2 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs @@ -134,9 +134,7 @@ namespace ZR.Admin.WebApi.Controllers.System LoginUser loginUser = Framework.JwtUtil.GetLoginUser(HttpContext); if (formFile == null) throw new CustomException("请选择文件"); - string fileExt = Path.GetExtension(formFile.FileName); - string fileName = FileUtil.HashFileName() + (fileExt.IsEmpty() ? ".png" : fileExt); - SysFile file = await FileService.SaveFileToLocal(hostEnvironment.WebRootPath, fileName, "", HttpContext.GetName(), formFile); + SysFile file = await FileService.SaveFileToLocal(hostEnvironment.WebRootPath, "", "", HttpContext.GetName(), formFile); UserService.UpdatePhoto(new SysUser() { Avatar = file.AccessUrl, UserId = loginUser.UserId }); return SUCCESS(new { imgUrl = file.AccessUrl });