1. 修改選單logo 預設圖

This commit is contained in:
Kai 2021-09-07 09:47:04 +08:00
parent 5d39b5fa73
commit 068977a5c8
3 changed files with 21 additions and 2 deletions

View File

@ -87,6 +87,25 @@ namespace SolarPower.Controllers
//取得當前登入使用者資訊
myUser = userRepository.GetMyUserInfoByAccount(myAccount);
myUser.Company = companyRepository.GetMyCompanyInfoById(myUser.CompanyId);
//判斷該檔案是否存在
if (!string.IsNullOrEmpty(myUser.Company.Logo))
{
var fullFilePath = Directory.GetCurrentDirectory() + "/wwwroot/" + Path.Combine("upload", "company_logo", myUser.Company.Logo);
if (!System.IO.File.Exists(fullFilePath))
{
myUser.Company.Logo = "/img/logo.png";
}
else
{
myUser.Company.Logo = Path.Combine("upload", "company_logo", myUser.Company.Logo);
}
}
else
{
myUser.Company.Logo = "/img/logo.png";
}
myUser.Role = roleRepository.GetMyRoleInfoById(myUser.RoleId);
List<string> auth_arr = new List<string>();

View File

@ -63,7 +63,7 @@ namespace SolarPower.Models
public int Id { get; set; }
public byte Status { get; set; } //狀態
public string Name { get; set; } //名稱
public string Logo { get { return "/upload/company_logo/" + logo; } set { logo = value; } }
public string Logo { get; set; }
}
//當前登入使用者的角色權限

View File

@ -25,7 +25,7 @@
//},
"BackgroundServiceCron": {
"CalcPowerStationJob": "0 5 * * * ?",
"CalcAvgPowerStationJob": "0/10 * * * * ?",
"CalcAvgPowerStationJob": "0 0 2 * * ?",
"OperationScheduleJob": "0 0 2 * * ?",
"CalcInverter15minJob": "0 2/15 * * * ?",
"SendEmailJob": "0 0/5 * * * ?",