Browse Source

PC首页显示图片BUG修改

anderx 7 years ago
parent
commit
331957174b

+ 4 - 0
src/main/java/com/goafanti/common/model/MarketingManagement.java

@@ -156,6 +156,10 @@ public class MarketingManagement {
      * @mbg.generated Tue Sep 26 14:34:04 CST 2017
      */
     public String getCoverImg() {
+    	if (coverImg.contains(",")) {
+    		String s[]=coverImg.split(",");
+    		coverImg=s[0];
+		}
         return coverImg;
     }
 

+ 3 - 2
src/main/webapp/WEB-INF/views/portal/index.html

@@ -382,7 +382,7 @@
 				<a th:each="item:${achievementList}"
 				th:href="@{/portal/technologyTrading/achievementDetail(id=${item.productId},type=${item.ownerType})}">
 					<div >
-						<img th:src="${item.coverImg}" alt="" />
+						<img th:src="${item.coverImg}?${avatarUploadHost + item.coverImg}:${portalHost + '/img/index_er1.jpg'}" alt=""  />
 						<div>
 							<h3 th:text="${item.name}"></h3>
 							<p th:text="${item.introduction}"></p>
@@ -398,7 +398,7 @@
 				<a  th:each="dtem:${demandList}" 
 					th:href="@{/portal/technologyTrading/demandDetail(id=${dtem.productId},type=${dtem.ownerType})}">
 					<div>
-						<img th:src="${dtem.coverImg}" alt="" />
+						<img th:src="${dtem.coverImg}?${avatarUploadHost + dtem.coverImg}:${portalHost + '/img/index_er1.jpg'}" alt=""  />
 						<div>
 							<h3 th:text="${dtem.name}"></h3>
 							<p th:text="${dtem.problemDes}"></p>
@@ -432,6 +432,7 @@
 					th:href="@{/portal/subscriberDetail.html(uid=${etem.id},type=${etem.type})}">
 						<div>
 							<img th:src="${etem.headPortraitUrl}" alt="" />
+							<img th:src="${etem.headPortraitUrl}?${avatarUploadHost+etem.headPortraitUrl}:${avatarUploadHost + '/default/person.jpg'}" alt=""  />
 							<div class="indexExpert_basc">
 								<h3 th:text="${etem.username}"></h3>
 								<span>/</span>