diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/IndexService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/IndexService.cs index 476235f..04b51ce 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/IndexService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/IndexService.cs @@ -25,7 +25,7 @@ namespace EasyBL.WEBAPP.SYS { //ads Swiper - public HttpResponseMessage Banner(string Lang) + public HttpResponseMessage Banner(string requestUrl, string Lang) { //string sMsg = null; SuccessResponseMessage srm = SugarBase.ExecTran(db => @@ -75,7 +75,7 @@ namespace EasyBL.WEBAPP.SYS if (hasMatch && !FilePathTotal.Contains(image.Image)) { - FilePathTotal.Add("http://www.origtek.com:9105/" + FilePath.FilePath); + FilePathTotal.Add("http://" + requestUrl + "/" + FilePath.FilePath.Replace("\\", "/")); } } @@ -101,7 +101,7 @@ namespace EasyBL.WEBAPP.SYS /// /// /// - public HttpResponseMessage BaseInfo(string OrgID,string Lang) + public HttpResponseMessage BaseInfo(string requestUrl,string Lang) { SuccessResponseMessage srm = null; string sError = null; @@ -110,10 +110,25 @@ namespace EasyBL.WEBAPP.SYS { do { + string OrgID = WebAppGlobalConstWord.TG_ORGID; + if (string.IsNullOrEmpty(Lang)) + { + Lang = WebAppGlobalConstWord.DEFAULT_LANGUAGE; + } var baseInfo = db.Queryable() //搜尋條件 .Where(x => x.OrgID == OrgID && x.Language == Lang) .First(); + if (baseInfo !=null) + { + var saFile = db.Queryable() + .Where(x => x.ParentID == baseInfo.Image) + .First(); + if (saFile != null) + { + baseInfo.Image = "http://"+ requestUrl + "/" + saFile.FilePath.Replace("\\","/"); + } + } srm = new SuccessResponseMessage(null, null); srm.DATA.Add(BLWording.REL, baseInfo); diff --git a/EuroTran/WebApp/Controllers/IndexController.cs b/EuroTran/WebApp/Controllers/IndexController.cs index c58231d..24a3d02 100644 --- a/EuroTran/WebApp/Controllers/IndexController.cs +++ b/EuroTran/WebApp/Controllers/IndexController.cs @@ -17,9 +17,10 @@ namespace WebApp.Controllers //ads Swiper [HttpGet] - public HttpResponseMessage Banner(string Lang) + public HttpResponseMessage Banner(string Lang) { - return new IndexService().Banner(Lang); + string requestUrl = this.Request.RequestUri.Authority; + return new IndexService().Banner(requestUrl,Lang); } /// @@ -28,9 +29,10 @@ namespace WebApp.Controllers /// /// [HttpGet] - public HttpResponseMessage BaseInfo(string OrgID, string Lang) + public HttpResponseMessage BaseInfo(string Lang) { - return new IndexService().BaseInfo(OrgID,Lang); + string requestUrl = this.Request.RequestUri.Authority; + return new IndexService().BaseInfo(requestUrl,Lang); } ///