From f1ef9e6c8ba3b9a095fbdedb9fd55c70f65878aa Mon Sep 17 00:00:00 2001 From: ysc Date: Thu, 4 Jul 2013 15:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86login.jsp=E9=A1=B5=E9=9D=A2=E4=B8=AD?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E7=9A=84JS(CSS)=E5=90=88=E5=B9=B6=E4=B8=BA?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APDPlatMultiMergeNamingStrategy.java | 2 + .../APDPlatSingleMergeNamingStrategy.java | 13 +- .../src/main/resources/wro4j_multi_merge.xml | 15 ++ .../src/main/resources/wro4j_single_merge.xml | 14 ++ APDPlat_Web/src/main/webapp/login.jsp | 15 +- .../src/main/webapp/login_no_merge.jsp | 182 ++++++++++++++++++ 6 files changed, 227 insertions(+), 14 deletions(-) create mode 100644 APDPlat_Web/src/main/webapp/login_no_merge.jsp diff --git a/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatMultiMergeNamingStrategy.java b/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatMultiMergeNamingStrategy.java index f9968e3a..f1978e38 100644 --- a/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatMultiMergeNamingStrategy.java +++ b/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatMultiMergeNamingStrategy.java @@ -46,6 +46,8 @@ public class APDPlatMultiMergeNamingStrategy implements NamingStrategy{ map.put("js_merge.js", "js/"); map.put("platform_css_merge.css", "platform/css/"); map.put("platform_js_merge.js", "platform/js/"); + map.put("login_merge.js", "js/"); + map.put("login_merge.css", "css/"); } @Override public String rename(String originalName, InputStream inputStream) throws IOException { diff --git a/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatSingleMergeNamingStrategy.java b/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatSingleMergeNamingStrategy.java index 7637b3d4..cc3d0cad 100644 --- a/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatSingleMergeNamingStrategy.java +++ b/APDPlat_Core/src/main/java/org/apdplat/platform/wro4j/APDPlatSingleMergeNamingStrategy.java @@ -26,14 +26,23 @@ */ /** - * + *SingleMerge是指对platform/include/common.jsp所引用的JS(CSS)合并为一个文件 * @author 杨尚川 */ public class APDPlatSingleMergeNamingStrategy implements NamingStrategy{ @Override public String rename(String originalName, InputStream inputStream) throws IOException { System.out.println("originalName:"+originalName); - originalName="platform/include/"+originalName; + if(originalName.contains("apdplat_merge")){ + originalName="platform/include/"+originalName; + } + if(originalName.contains("login_merge.js")){ + originalName="js/"+originalName; + } + if(originalName.contains("login_merge.css")){ + originalName="css/"+originalName; + } + System.out.println("originalName:"+originalName); return originalName; } diff --git a/APDPlat_Web/src/main/resources/wro4j_multi_merge.xml b/APDPlat_Web/src/main/resources/wro4j_multi_merge.xml index 10603bec..9b656a55 100644 --- a/APDPlat_Web/src/main/resources/wro4j_multi_merge.xml +++ b/APDPlat_Web/src/main/resources/wro4j_multi_merge.xml @@ -76,4 +76,19 @@ /platform/js/IconCombo.js /platform/js/PageSizePlugin.js + + + /extjs/css/ext-all.css + /extjs/css/ext-patch.css + /css/login.css + + /extjs/js/adapter/ext/ext-base.js + /extjs/js/ext-all.js + /extjs/ux/Toast.js + /extjs/js/ext-lang-zh_CN.js + /js/validate.js + /js/md5.js + /js/login.js + /js/MSIE.PNG.js + \ No newline at end of file diff --git a/APDPlat_Web/src/main/resources/wro4j_single_merge.xml b/APDPlat_Web/src/main/resources/wro4j_single_merge.xml index 9a43128f..32af2003 100644 --- a/APDPlat_Web/src/main/resources/wro4j_single_merge.xml +++ b/APDPlat_Web/src/main/resources/wro4j_single_merge.xml @@ -54,4 +54,18 @@ /platform/js/IconCombo.js /platform/js/PageSizePlugin.js + + /extjs/css/ext-all.css + /extjs/css/ext-patch.css + /css/login.css + + /extjs/js/adapter/ext/ext-base.js + /extjs/js/ext-all.js + /extjs/ux/Toast.js + /extjs/js/ext-lang-zh_CN.js + /js/validate.js + /js/md5.js + /js/login.js + /js/MSIE.PNG.js + \ No newline at end of file diff --git a/APDPlat_Web/src/main/webapp/login.jsp b/APDPlat_Web/src/main/webapp/login.jsp index cd50b475..0bcd478e 100644 --- a/APDPlat_Web/src/main/webapp/login.jsp +++ b/APDPlat_Web/src/main/webapp/login.jsp @@ -86,19 +86,11 @@ String shortcut=PropertyHolder.getProperty("module.short.name"); %> - + <%=appName%> - - - - - - - - - - + + - diff --git a/APDPlat_Web/src/main/webapp/login_no_merge.jsp b/APDPlat_Web/src/main/webapp/login_no_merge.jsp new file mode 100644 index 00000000..cd50b475 --- /dev/null +++ b/APDPlat_Web/src/main/webapp/login_no_merge.jsp @@ -0,0 +1,182 @@ +<%-- + APDPlat - Application Product Development Platform + Copyright (c) 2013, 杨尚川, yang-shangchuan@qq.com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="org.apdplat.module.security.service.OnlineUserService"%> +<%@page import="org.apdplat.module.security.service.SpringSecurityService"%> +<%@page import="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"%> +<%@page import="org.apdplat.module.security.service.UserDetailsServiceImpl"%> +<%@page import="org.apdplat.module.system.service.PropertyHolder"%> +<%@page import="java.util.Collection"%> +<%@page import="org.apdplat.platform.util.FileUtils"%> + +<% +response.addHeader("login","true"); +//供记录用户登录日志使用 +String userAgent=request.getHeader("User-Agent"); +request.getSession().setAttribute("userAgent", userAgent); +if(!SpringSecurityService.isSecurity()){ + //如果没有启用安全机制则直接进入主界面 + response.sendRedirect("platform/index.jsp"); + return; +} +String name=OnlineUserService.getUsername(request.getSession(true).getId()); +if(!"匿名用户".equals(name)){ + //用户已经等登录直接进入主界面 + response.sendRedirect("platform/index.jsp"); + return; +} + +String message=""; +String state=request.getParameter("state"); +if(state!=null){ + response.addHeader("state",state); +} +if("checkCodeError".equals(state)){ + response.addHeader("checkCodeError","true"); + message="验证码错误"; + response.getWriter().write(message); + response.getWriter().flush(); + response.getWriter().close(); + return; +} + +Object obj=session.getAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY); + +String lastUsername=""; +if(obj!=null){ + lastUsername=obj.toString(); + if(request.getParameter("login_error")!=null){ + String tip=UserDetailsServiceImpl.getMessage(lastUsername); + if(tip!=null){ + message=tip; + response.addHeader("login_error","true"); + response.getWriter().write(message); + response.getWriter().flush(); + response.getWriter().close(); + return; + } + } + } +String contextPath=org.apdplat.module.system.service.SystemListener.getContextPath(); +String appName=PropertyHolder.getProperty("app.name"); +String requestCode=""; +if(FileUtils.existsFile("/WEB-INF/licence")){ + Collection reqs = FileUtils.getTextFileContent("/WEB-INF/licence"); + if(reqs!=null && reqs.size()==1){ + requestCode=reqs.iterator().next().toString(); + } +} +String shortcut=PropertyHolder.getProperty("module.short.name"); +%> + + + + <%=appName%> + + + + + + + + + + + + + + + + + +
+
+
Loading...Loading...
+
+
+ + + \ No newline at end of file