Browse Source

修改後端網址獲取方式

Dev
18300102974 2 years ago
parent
commit
8e1d15c22f
  1. 10
      EuroTran/EasyBL.WEBAPP/ShowEasy/IndexService.cs
  2. 6
      EuroTran/WebApp/Controllers/IndexController.cs

10
EuroTran/EasyBL.WEBAPP/ShowEasy/IndexService.cs

@ -25,7 +25,7 @@ namespace EasyBL.WEBAPP.SYS
{
//ads Swiper
public HttpResponseMessage Banner(string requestUrl, string Lang)
public HttpResponseMessage Banner(string Lang)
{
//string sMsg = null;
SuccessResponseMessage srm = SugarBase.ExecTran(db =>
@ -46,6 +46,7 @@ namespace EasyBL.WEBAPP.SYS
}
string requestUrl = Common.ConfigGetValue("", "ida:RedirectUri");
var saTheme = db.Queryable<SETB_SAP_Theme>() ////取得所有資料
.Where(x => x.Language == Lang)
.ToList();
@ -75,7 +76,7 @@ namespace EasyBL.WEBAPP.SYS
if (hasMatch && !FilePathTotal.Contains(image.Image)) {
FilePathTotal.Add("http://" + requestUrl + "/" + FilePath.FilePath.Replace("\\", "/"));
FilePathTotal.Add(requestUrl + "/" + FilePath.FilePath.Replace("\\", "/"));
}
}
@ -101,7 +102,7 @@ namespace EasyBL.WEBAPP.SYS
/// <param name="OrgID"></param>
/// <param name="Lang"></param>
/// <returns></returns>
public HttpResponseMessage BaseInfo(string requestUrl,string Lang)
public HttpResponseMessage BaseInfo(string Lang)
{
SuccessResponseMessage srm = null;
string sError = null;
@ -115,6 +116,7 @@ namespace EasyBL.WEBAPP.SYS
{
Lang = WebAppGlobalConstWord.DEFAULT_LANGUAGE;
}
string requestUrl = Common.ConfigGetValue("", "ida:RedirectUri");
var baseInfo = db.Queryable<SETB_SAP_BasicInfo>()
//搜尋條件
.Where(x => x.OrgID == OrgID && x.Language == Lang)
@ -126,7 +128,7 @@ namespace EasyBL.WEBAPP.SYS
.First();
if (saFile != null)
{
baseInfo.Image = "http://"+ requestUrl + "/" + saFile.FilePath.Replace("\\","/");
baseInfo.Image = requestUrl +"/"+ saFile.FilePath.Replace("\\","/");
}
}
srm = new SuccessResponseMessage(null, null);

6
EuroTran/WebApp/Controllers/IndexController.cs

@ -19,8 +19,7 @@ namespace WebApp.Controllers
[HttpGet]
public HttpResponseMessage Banner(string Lang)
{
string requestUrl = this.Request.RequestUri.Authority;
return new IndexService().Banner(requestUrl,Lang);
return new IndexService().Banner(Lang);
}
/// <summary>
@ -31,8 +30,7 @@ namespace WebApp.Controllers
[HttpGet]
public HttpResponseMessage BaseInfo(string Lang)
{
string requestUrl = this.Request.RequestUri.Authority;
return new IndexService().BaseInfo(requestUrl,Lang);
return new IndexService().BaseInfo(Lang);
}
/// <summary>

Loading…
Cancel
Save