로그인시 사용자 유형 삭제.

세션 유지시간 12시간으로 설정.
master
강석 최 2024-04-29 11:35:11 +09:00
parent ba0404f20f
commit f4526c195d
3 changed files with 26 additions and 49 deletions

View File

@ -9,7 +9,6 @@
FROM WEB_DUP_MEMBER FROM WEB_DUP_MEMBER
WHERE WHERE
TRIM(USERID) = #{userid} TRIM(USERID) = #{userid}
AND CLS = #{cls}
AND (PASSWD = #{passwd} or PASSWD = #{passwd2}) AND (PASSWD = #{passwd} or PASSWD = #{passwd2})
AND USERID NOT IN ( AND USERID NOT IN (
SELECT USERID SELECT USERID
@ -31,18 +30,6 @@
<if test="passwd != null"> <if test="passwd != null">
<![CDATA[ AND (PASSWD = #{passwd} or PASSWD = #{passwd2})]]> <![CDATA[ AND (PASSWD = #{passwd} or PASSWD = #{passwd2})]]>
</if> </if>
<if test="cls != null">
<![CDATA[ AND (CLS = #{cls}]]>
<if test="cls2 != null">
<if test="cls2 == 2">
<![CDATA[ OR CLS = '2') ]]>
</if>
</if>
<if test="cls2 == null">
<![CDATA[ ) ]]>
</if>
</if>
</select> </select>
<select id="checkWebMemberIn" parameterType="HashMap" resultType="int"> <select id="checkWebMemberIn" parameterType="HashMap" resultType="int">

View File

@ -581,9 +581,18 @@ public class LoginController {
// 로그인 // 로그인
@RequestMapping(value = "/login.do", method = RequestMethod.POST) @RequestMapping(value = "/login.do", method = RequestMethod.POST)
public ModelAndView login(HttpSession session, Map<String, Object> map, HttpServletRequest request, HttpServletResponse response, @RequestParam("location") String location, @RequestParam("login_param") String login_param, @RequestParam("id") String id, @RequestParam("cls") String cls, @RequestParam("pass") String pass) throws Exception { public ModelAndView login(
HttpSession session,
Map<String, Object> map,
HttpServletRequest request,
HttpServletResponse response,
@RequestParam("location") String location,
@RequestParam("login_param") String login_param,
@RequestParam("id") String id,
@RequestParam("pass") String pass) throws Exception {
ModelAndView mv = new ModelAndView("home/login"); ModelAndView mv = new ModelAndView("home/login");
String cls = "";
String msg = ""; String msg = "";
String url = ""; String url = "";
String sysdate = ""; String sysdate = "";
@ -639,7 +648,6 @@ public class LoginController {
map.put("passwd", pass); map.put("passwd", pass);
map.put("passwd2", pass2); map.put("passwd2", pass2);
map.put("cls", cls);
boolean loginSuccess = false; boolean loginSuccess = false;
String dup_id; String dup_id;
@ -697,7 +705,6 @@ public class LoginController {
map.put("passwd", pass); map.put("passwd", pass);
map.put("passwd2", pass2); map.put("passwd2", pass2);
map.put("cls", cls);
selectWebMemberIn = loginService.selectWebMemberIn(map); selectWebMemberIn = loginService.selectWebMemberIn(map);
if(selectWebMemberIn == null) { if(selectWebMemberIn == null) {
@ -716,7 +723,6 @@ public class LoginController {
}else { }else {
// 관리자일 경우 // 관리자일 경우
map.put("userid", userid); map.put("userid", userid);
map.put("cls", "9");
selectWebMemberIn = loginService.selectWebMemberIn(map); selectWebMemberIn = loginService.selectWebMemberIn(map);
map.clear(); map.clear();
@ -739,11 +745,14 @@ public class LoginController {
cls = selectWebMemberIn.get("cls").toString(); cls = selectWebMemberIn.get("cls").toString();
if (!"".equals(request.getSession()) && !request.getSession().equals(null)) { if (!"".equals(request.getSession()) && !request.getSession().equals(null)) {
request.getSession().setAttribute("USERID", userid); session = request.getSession();
request.getSession().setAttribute("USERNAME", userName); session.setAttribute("USERID", userid);
request.getSession().setAttribute("MASTERCODE", masterCode); session.setAttribute("USERNAME", userName);
request.getSession().setAttribute("CLS", cls); session.setAttribute("MASTERCODE", masterCode);
request.getSession().setAttribute("GOVECODE", goveCode); session.setAttribute("CLS", cls);
session.setAttribute("GOVECODE", goveCode);
session.setMaxInactiveInterval(43200);
// 2017.10.13 dhlee 세션 ip , 환경 추가 // 2017.10.13 dhlee 세션 ip , 환경 추가
InetAddress ip = InetAddress.getLocalHost(); InetAddress ip = InetAddress.getLocalHost();
@ -761,8 +770,6 @@ public class LoginController {
map.put("userid", userid); map.put("userid", userid);
map.put("passwd", pass); map.put("passwd", pass);
map.put("passwd2", pass2); map.put("passwd2", pass2);
map.put("cls", cls);
map.put("cls2", "2");
selectWebMemberIn = loginService.selectWebMemberIn(map); selectWebMemberIn = loginService.selectWebMemberIn(map);
map.clear(); map.clear();
@ -784,11 +791,13 @@ public class LoginController {
cls = selectWebMemberIn.get("cls").toString(); cls = selectWebMemberIn.get("cls").toString();
goveCode = selectWebMemberIn.get("govement_code").toString(); goveCode = selectWebMemberIn.get("govement_code").toString();
request.getSession().setAttribute("USERID", userid); session = request.getSession();
request.getSession().setAttribute("USERNAME", userName); session.setAttribute("USERID", userid);
request.getSession().setAttribute("MASTERCODE", masterCode); session.setAttribute("USERNAME", userName);
request.getSession().setAttribute("CLS", cls); session.setAttribute("MASTERCODE", masterCode);
request.getSession().setAttribute("GOVECODE", goveCode); session.setAttribute("CLS", cls);
session.setAttribute("GOVECODE", goveCode);
session.setMaxInactiveInterval(43200);
// 2017.10.13 dhlee 세션 ip , 환경 추가 // 2017.10.13 dhlee 세션 ip , 환경 추가
InetAddress ip = InetAddress.getLocalHost(); InetAddress ip = InetAddress.getLocalHost();

View File

@ -116,10 +116,7 @@
} }
function login(){ function login(){
if(document.login.cls[0].checked == false && document.login.cls[1].checked == false && document.login.cls[2].checked == false){ if (document.login.id.value == ""){
alert("회원 유형을 선택하여 주십시요");
return true;
}else if (document.login.id.value == ""){
alert('아이디를 입력하여 주시기 바랍니다.'); alert('아이디를 입력하여 주시기 바랍니다.');
document.login.id.focus(); document.login.id.focus();
return true; return true;
@ -164,22 +161,6 @@
<input type="hidden" name="login_param" value=""> <input type="hidden" name="login_param" value="">
<h1 class="contents-title"><span class="contents-title-text">로그인</span></h1> <h1 class="contents-title"><span class="contents-title-text">로그인</span></h1>
<div class="contents-row t-center padT20">
<div class="gg-radio-inline login-radio">
<label class="gg-radio gg-radio-outline">
<input type="radio" name="cls" value="0" checked /> 개인
<span></span>
</label>
<label class="gg-radio gg-radio-outline">
<input type="radio" name="cls" value="1" /> 기업
<span></span>
</label>
<label class="gg-radio gg-radio-outline">
<input type="radio" name="cls" value="3" /> 지자체
<span></span>
</label>
</div>
</div>
<div class="contents-row padT20"> <div class="contents-row padT20">
<label for="id" class="control-label marR5">아이디</label> <label for="id" class="control-label marR5">아이디</label>
<input name="id" id="id" type="text" tabIndex="1" class="gg-input" maxlength="15" placeholder="아이디"> <input name="id" id="id" type="text" tabIndex="1" class="gg-input" maxlength="15" placeholder="아이디">