修改登录页面信息
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Infrastructure;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
@@ -13,10 +14,11 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
private OptionsSetting OptionsSetting;
|
||||
|
||||
public UploadController(IOptions<OptionsSetting> optionsSetting)
|
||||
private IWebHostEnvironment WebHostEnvironment;
|
||||
public UploadController(IOptions<OptionsSetting> optionsSetting, IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
OptionsSetting = optionsSetting.Value;
|
||||
WebHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
/// <summary>
|
||||
/// 存储文件
|
||||
@@ -28,7 +30,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传图片不能为空");
|
||||
string fileExt = Path.GetExtension(formFile.FileName);
|
||||
string savePath = Path.Combine("wwwroot", FileUtil.GetdirPath("uploads"));
|
||||
string savePath = Path.Combine(WebHostEnvironment.WebRootPath, FileUtil.GetdirPath("uploads"));
|
||||
|
||||
if (!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user