Parcourir la source

求购模板允许游客下载

liusw il y a 7 ans
Parent
commit
a91add7483

+ 6 - 1
src/main/java/com/uas/platform/b2c/core/support/view/JxlsExcelView.java

@@ -8,6 +8,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.support.LocalizedResourceHelper;
+import org.springframework.util.StringUtils;
 import org.springframework.web.servlet.support.RequestContextUtils;
 import org.springframework.web.servlet.view.document.AbstractExcelView;
 
@@ -87,7 +88,11 @@ public class JxlsExcelView extends AbstractExcelView {
 		}
 
 		public Export() {
-			this.user = SystemSession.getUser().getUserName();
+			if (StringUtils.isEmpty(SystemSession.getUser())) {
+				this.user = "游客";
+			} else {
+				this.user = SystemSession.getUser().getUserName();
+			}
 			this.date = DateFormatUtils.DATETIME_FORMAT.format(new Date());
 		}
 	}

+ 1 - 0
src/main/webapp/WEB-INF/spring/webmvc.xml

@@ -113,6 +113,7 @@
 			<mvc:exclude-mapping path="/seek/qualityBuyer/getBuyerPageInfo"/>
 			<mvc:exclude-mapping path="/seek/getSeekPageInfo"/>
 			<mvc:exclude-mapping path="/seek/getSeekRanking"/>
+			<mvc:exclude-mapping path="/seek/release/template"/>
 			<bean class="com.uas.platform.b2c.core.filter.SSOInterceptor"></bean>
 		</mvc:interceptor>
 		<!-- 对所有的请求拦截,将Session中的User信息设置进SystemSession -->