1. 修改選單logo 預設圖
This commit is contained in:
parent
5d39b5fa73
commit
068977a5c8
@ -87,6 +87,25 @@ namespace SolarPower.Controllers
|
|||||||
//取得當前登入使用者資訊
|
//取得當前登入使用者資訊
|
||||||
myUser = userRepository.GetMyUserInfoByAccount(myAccount);
|
myUser = userRepository.GetMyUserInfoByAccount(myAccount);
|
||||||
myUser.Company = companyRepository.GetMyCompanyInfoById(myUser.CompanyId);
|
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);
|
myUser.Role = roleRepository.GetMyRoleInfoById(myUser.RoleId);
|
||||||
|
|
||||||
List<string> auth_arr = new List<string>();
|
List<string> auth_arr = new List<string>();
|
||||||
|
|||||||
@ -63,7 +63,7 @@ namespace SolarPower.Models
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public byte Status { get; set; } //狀態
|
public byte Status { get; set; } //狀態
|
||||||
public string Name { get; set; } //名稱
|
public string Name { get; set; } //名稱
|
||||||
public string Logo { get { return "/upload/company_logo/" + logo; } set { logo = value; } }
|
public string Logo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
//當前登入使用者的角色權限
|
//當前登入使用者的角色權限
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
//},
|
//},
|
||||||
"BackgroundServiceCron": {
|
"BackgroundServiceCron": {
|
||||||
"CalcPowerStationJob": "0 5 * * * ?",
|
"CalcPowerStationJob": "0 5 * * * ?",
|
||||||
"CalcAvgPowerStationJob": "0/10 * * * * ?",
|
"CalcAvgPowerStationJob": "0 0 2 * * ?",
|
||||||
"OperationScheduleJob": "0 0 2 * * ?",
|
"OperationScheduleJob": "0 0 2 * * ?",
|
||||||
"CalcInverter15minJob": "0 2/15 * * * ?",
|
"CalcInverter15minJob": "0 2/15 * * * ?",
|
||||||
"SendEmailJob": "0 0/5 * * * ?",
|
"SendEmailJob": "0 0/5 * * * ?",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user