From 2cd656e4c0db41910bb6ac0958e1d442df90afd7 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Thu, 15 Jun 2023 10:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E4=B8=AD?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=94=A8=E6=88=B7=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E6=88=90=20=E5=B7=B2=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=8D=E5=BA=94=E8=83=BD=E5=A4=9F=E5=86=8D=E8=AE=BF=E9=97=AE?= =?UTF-8?q?login=E7=99=BB=E5=BD=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chenx221 --- .../chenx221/controller/UserController.class | Bin 4177 -> 6029 bytes .../cyou/chenx221/mapper/UserMapper.class | Bin 442 -> 496 bytes .../classes/cyou/chenx221/pojo/User.class | Bin 2380 -> 2398 bytes .../WEB-INF/classes/mapper/UserMapper.xml | 4 ++ .../WEB-INF/classes/spring-security.xml | 1 + .../WEB-INF/views/dashboard.jsp | 4 +- .../WEB-INF/views/login.jsp | 10 ++- .../WEB-INF/views/usermanage.jsp | 20 ++++-- .../chenx221/controller/UserController.java | 67 +++++++++++++++++- .../java/cyou/chenx221/mapper/UserMapper.java | 3 + .../main/java/cyou/chenx221/pojo/User.java | 8 +-- .../src/main/resources/mapper/UserMapper.xml | 4 ++ .../src/main/resources/spring-security.xml | 1 + project2/web/WEB-INF/views/dashboard.jsp | 10 +-- project2/web/WEB-INF/views/login.jsp | 10 ++- project2/web/WEB-INF/views/usermanage.jsp | 20 ++++-- 16 files changed, 131 insertions(+), 31 deletions(-) diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/UserController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou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O$nNpH?ddJBEzWh-Jo z*MPcg7WVvyx5*OR!QGj$w!+B|2QQ8WMqC9_h-9^v(pF6aA3&h@o6r{Lk5Pq UJUr$R*9czF(}-T;HAlVVFCbKy-2eap diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/UserMapper.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/UserMapper.class index 9d5c42e2496d79fe8b90d827cc23b2cc23c38430..e3b34250a1e5c619c0c412d3668f914bf12f2440 100644 GIT binary patch delta 84 zcmdnR{DGP4)W2Q(7#J9A8H6`-@h}SVWabs87L|koi83Qb1{sZs1(Hmfo|8ow^BGwt hw=gQmu`n|5GVlSlFfs6hNdX2yAkD_W$RNbP0064-5552Z delta 79 zcmeysyo;IZ)W2Q(7#J9A83Z?S@i0zyVazpWW?^JtWng1q0MhIX9AKK0fs28Wfg7lj WiGc@*dBH3`27VyT29yzCU;qFg*$68D diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/User.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/User.class index 69cf79cad6973f699f6c905a95087d5b366a1e8c..a52f3baab9661511ce6354af89254d9efba01a3a 100644 GIT binary patch delta 351 zcmZvWPfG$}5XNWTw|#e4jbvN1lGY+ClW6G=Yo$R%2$r8ATG(YV#6wA^f;xGNV!lX_ zSBb9SXXsYnp)NLxb?PwlV;<(2XL{DV_3#;U5L6Jh{CeZDKQ&>3fcXS00L!8tPzt-E zmZv+Bqpq;H;$+Cgx*3J7qoD~Qm0zu$`&Yi(@SBlaZMMQFyeJ`=^I4}kX8?ebe#|D>)Os&v?%oE*fOLU-O z)K=s4rn%_Qw^pGWR*uz{EW!@msuSF$o|?uieW*jp`Bcy|xJMN|NSFRSoTXQNS(ag& h-8TFB`dWPO_aJ&7Jo1b(4ldi&Hj3!c%io+d%RhIeOS%96 delta 306 zcmca7bVg{xGf6H+2DX&clElm$P6j3hc^(D@21P~&rp%OyAH*h$GVW!xn*5eYbrQ3X zw5MhmBLio8YKaS2IgnipV^7Xt+QuxZp*eXYlQ0J(11nI%Gi9iOEX$b zj$lt=wq&pZsRqhjW>=H2X0X99TYD>m++;xx9d4i#fs%|2wonVAIW!r~Cbx2UGlDF% J0kZix0{|D|LiYdw diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/UserMapper.xml b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/UserMapper.xml index 62bdfb6..618d1bf 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/UserMapper.xml +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/UserMapper.xml @@ -16,4 +16,8 @@ SELECT * FROM user + + INSERT INTO user (username, password, roles, detail) + VALUES (#{username}, #{password}, #{roles}, #{detail}) + diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml index af4a99b..d5f54d4 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml @@ -26,6 +26,7 @@ + diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp index 6a94812..4898356 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp @@ -1,3 +1,4 @@ +<%@ page import="cyou.chenx221.helper.UsernameHelper" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> @@ -19,7 +20,13 @@ - +<% + if(new UsernameHelper().getCurrentUsername()!=null){ + //redirect /dashboard + //note: 登陆了的就别乱访问了 + response.sendRedirect("dashboard"); + } +%>