From 18e0aa1a2d830898e7656f045c2996e21f8851f0 Mon Sep 17 00:00:00 2001 From: 18300102974 Date: Wed, 1 Feb 2023 11:13:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E7=8D=B2?= =?UTF-8?q?=E5=8F=96=E6=9C=8D=E5=8B=99=E5=99=A8=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EasyBL.WEBAPP/ShowEasy/IndexService.cs | 21 ++++++++++++++++--- .../WebApp/Controllers/IndexController.cs | 10 +++++---- 2 files changed, 24 insertions(+), 7 deletions(-) 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); } ///