Browse Source

1.修改数据库配置;
2.优化登录逻辑。

Yumin 6 years ago
parent
commit
9d3f616c55

+ 26 - 0
TQE.iml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="web" name="Web">
+      <configuration>
+        <descriptors>
+          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/WebRoot/WEB-INF/web.xml" />
+        </descriptors>
+        <webroots>
+          <root url="file://$MODULE_DIR$/WebRoot" relative="/" />
+        </webroots>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/test" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="lib" level="project" />
+    <orderEntry type="library" name="lib1" level="project" />
+  </component>
+</module>

+ 3 - 3
WebRoot/WEB-INF/classes/dbconfig.properties

@@ -1,7 +1,7 @@
-url:jdbc:mysql://localhost:3306/tqe?characterEncoding=utf-8
+url:jdbc:mysql://rm-uf64guljnha668n05io.mysql.rds.aliyuncs.com:3306/tqe?characterEncoding=utf-8
 driverClassName:com.mysql.jdbc.Driver
-username:root
-password:root
+username:zzuli
+password:Zzuli123
 
 
  

+ 4 - 4
WebRoot/WEB-INF/jsp/index.jsp

@@ -192,11 +192,11 @@
                     lastIndex = imageSrc.length;
                 }
                 imageSrc = imageSrc.substring(0,lastIndex);
-                if(type =='student' || type == 'teacher'){
-                    valifImage.attr('src',imageSrc+"?random="+Math.random());
-                }else{
+                // if(type =='student' || type == 'teacher'){
+                //     valifImage.attr('src',imageSrc+"?random="+Math.random());
+                // }else{
                     valifImage.attr('src',imageSrc+"?type=inner&random="+Math.random());
-                }
+                // }
             }
             $("#verificationCode").val('');
         }

+ 3 - 3
config/dbconfig.properties

@@ -1,7 +1,7 @@
-url:jdbc:mysql://localhost:3306/tqe?characterEncoding=utf-8
+url:jdbc:mysql://rm-uf64guljnha668n05io.mysql.rds.aliyuncs.com:3306/tqe?characterEncoding=utf-8
 driverClassName:com.mysql.jdbc.Driver
-username:root
-password:root
+username:zzuli
+password:Zzuli123
 
 
  

+ 1 - 0
src/com/tqe/controller/LoginController.java

@@ -214,6 +214,7 @@ public class LoginController extends BaseController {
 
     private String schoolSecurityCheck(User user, String verificationCode, HttpSession session) {
         String errorMsg = null;
+        if (true) return errorMsg;
         String proxyJsessionId = (String) session.getAttribute("proxyJsessionId");
         if (StringUtils.isBlank(proxyJsessionId)) {
             errorMsg = "从教务系统获取JsessionId出错!暂时不能进行登陆";

+ 4 - 6
src/com/tqe/utils/ImageController.java

@@ -16,10 +16,8 @@ import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.awt.*;
 import java.awt.image.BufferedImage;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.Random;
@@ -46,11 +44,11 @@ public class ImageController extends BaseController{
             loginType = (LoginType) session.getAttribute(BaseConfigKye.LoginType);
         }
 
-        if(LoginType.INNER.equals(loginType)){
+//        if(LoginType.INNER.equals(loginType)){
             createValidatorImage(session, response);
-        }else if(LoginType.SCHOOL.equals(loginType)){
-            fetchSchoolImage(session,response);
-        }
+//        }else if(LoginType.SCHOOL.equals(loginType)){
+//            fetchSchoolImage(session,response);
+//        }
 	}
 
     private void fetchSchoolImage(HttpSession session,HttpServletResponse response){