비밀번호 초기화, HTML 읽어와 이메일전송
This commit is contained in:
parent
939c6d459b
commit
9e942931dc
77
.classpath
77
.classpath
@ -1,39 +1,38 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5"/>
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
</classpath>
|
||||||
</classpath>
|
|
||||||
|
|||||||
37
src/main/java/nlib/mail/EmailSender.java
Normal file
37
src/main/java/nlib/mail/EmailSender.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package nlib.mail;
|
||||||
|
|
||||||
|
import javax.mail.internet.InternetAddress;
|
||||||
|
import javax.mail.internet.MimeMessage;
|
||||||
|
import javax.mail.internet.MimeMessage.RecipientType;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.mail.javamail.JavaMailSender;
|
||||||
|
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import nlib.mail.service.EmailVO;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class EmailSender {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected JavaMailSender mailSender;
|
||||||
|
|
||||||
|
public void SendEmail(EmailVO email) throws Exception {
|
||||||
|
MimeMessage msg = mailSender.createMimeMessage();
|
||||||
|
MimeMessageHelper helper = new MimeMessageHelper(msg, true, "utf-8");
|
||||||
|
helper.setText(email.getContent(), true); //***HTML 적용
|
||||||
|
helper.setTo(email.getReciver());
|
||||||
|
helper.setSubject(email.getSubject());
|
||||||
|
helper.setFrom("siasia0824@gmail.com");
|
||||||
|
|
||||||
|
|
||||||
|
/* msg.setSubject(email.getSubject());
|
||||||
|
msg.setText(email.getContent(),"text/html");
|
||||||
|
msg.setText
|
||||||
|
msg.setRecipient(RecipientType.TO , new InternetAddress(email.getReciver()));
|
||||||
|
*/
|
||||||
|
mailSender.send(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
src/main/java/nlib/mail/service/EmailVO.java
Normal file
35
src/main/java/nlib/mail/service/EmailVO.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package nlib.mail.service;
|
||||||
|
|
||||||
|
public class EmailVO {
|
||||||
|
|
||||||
|
private String subject;
|
||||||
|
private String content;
|
||||||
|
private String regdate;
|
||||||
|
private String reciver;
|
||||||
|
|
||||||
|
public String getReciver() {
|
||||||
|
return reciver;
|
||||||
|
}
|
||||||
|
public void setReciver(String reciver) {
|
||||||
|
this.reciver = reciver;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubject() {
|
||||||
|
return subject;
|
||||||
|
}
|
||||||
|
public void setSubject(String subject) {
|
||||||
|
this.subject = subject;
|
||||||
|
}
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
public String getRegdate() {
|
||||||
|
return regdate;
|
||||||
|
}
|
||||||
|
public void setRegdate(String regdate) {
|
||||||
|
this.regdate = regdate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -27,7 +27,7 @@ public interface MemberService
|
|||||||
|
|
||||||
public DataApiResVO certificateMember(DataApiReqVO reqVO);
|
public DataApiResVO certificateMember(DataApiReqVO reqVO);
|
||||||
|
|
||||||
public DataApiResVO insertMemberInfo(DataApiReqVO reqVO);
|
public void insertMemberInfo(NlibLoginVO vo) throws Exception;
|
||||||
|
|
||||||
public DataApiResVO sendEmailForMemberJoining(DataApiReqVO reqVO);
|
public DataApiResVO sendEmailForMemberJoining(DataApiReqVO reqVO);
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public interface MemberService
|
|||||||
|
|
||||||
public DataApiResVO initPassword(DataApiReqVO reqVO);
|
public DataApiResVO initPassword(DataApiReqVO reqVO);
|
||||||
|
|
||||||
public DataApiResVO changePassword(DataApiReqVO reqVO);
|
public void changePassword(NlibLoginVO vo) throws Exception;
|
||||||
|
|
||||||
public DataApiResVO selectMemberInfo(DataApiReqVO reqVO);
|
public DataApiResVO selectMemberInfo(DataApiReqVO reqVO);
|
||||||
|
|
||||||
@ -43,5 +43,9 @@ public interface MemberService
|
|||||||
|
|
||||||
public DataApiResVO leaveMember(DataApiReqVO reqVO);
|
public DataApiResVO leaveMember(DataApiReqVO reqVO);
|
||||||
|
|
||||||
|
public String numberGen(int i, int j);
|
||||||
|
|
||||||
|
public String createInitPwd();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
27
src/main/java/nlib/user/service/UserInfoService.java
Normal file
27
src/main/java/nlib/user/service/UserInfoService.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
package nlib.user.service;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description :
|
||||||
|
* @author
|
||||||
|
* @since
|
||||||
|
* @version
|
||||||
|
* @see
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* << Modification Information >>
|
||||||
|
*
|
||||||
|
* Date Modifier Expression
|
||||||
|
* ------- -------- ---------------------------
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public interface UserInfoService
|
||||||
|
{
|
||||||
|
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception;
|
||||||
|
|
||||||
|
public void updateMyInfo(NlibLoginVO vo) throws Exception;
|
||||||
|
}
|
||||||
@ -3,51 +3,33 @@ package nlib.user.service.impl;
|
|||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||||
import nlib.restful.service.DataApiReqVO;
|
import nlib.restful.service.DataApiReqVO;
|
||||||
import nlib.restful.service.DataApiResVO;
|
import nlib.restful.service.DataApiResVO;
|
||||||
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
|
||||||
@Repository("memberDAO")
|
@Mapper("memberDAO")
|
||||||
public class MemberDAO
|
public interface MemberDAO
|
||||||
{
|
{
|
||||||
public DataApiResVO selectMemberJoiningInfo(DataApiReqVO reqVO) {
|
public DataApiResVO selectMemberJoiningInfo(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO certificateMember(DataApiReqVO reqVO) {
|
public DataApiResVO certificateMember(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO insertMemberInfo(DataApiReqVO reqVO) {
|
public void insertMemberInfo(NlibLoginVO vo) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO sendEmailForMemberJoining(DataApiReqVO reqVO) {
|
public DataApiResVO sendEmailForMemberJoining(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO searchId(DataApiReqVO reqVO) {
|
public DataApiResVO searchId(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO initPassword(DataApiReqVO reqVO) {
|
public DataApiResVO initPassword(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO changePassword(DataApiReqVO reqVO) {
|
public void changePassword(NlibLoginVO vo) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO selectMemberInfo(DataApiReqVO reqVO) {
|
public DataApiResVO selectMemberInfo(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO updateMemberInfo(DataApiReqVO reqVO) {
|
public DataApiResVO updateMemberInfo(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataApiResVO leaveMember(DataApiReqVO reqVO) {
|
public DataApiResVO leaveMember(DataApiReqVO reqVO) throws Exception;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,16 +1,30 @@
|
|||||||
|
|
||||||
package nlib.user.service.impl;
|
package nlib.user.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
|
||||||
import nlib.restful.service.DataApiReqVO;
|
import nlib.restful.service.DataApiReqVO;
|
||||||
import nlib.restful.service.DataApiResVO;
|
import nlib.restful.service.DataApiResVO;
|
||||||
import nlib.user.service.MemberService;
|
import nlib.user.service.MemberService;
|
||||||
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
|
||||||
@Service("memberService")
|
@Service("memberService")
|
||||||
public class MemberServiceImpl implements MemberService
|
public class MemberServiceImpl implements MemberService
|
||||||
{
|
{
|
||||||
|
@Resource(name="memberDAO")
|
||||||
private MemberDAO memberDAO;
|
private MemberDAO memberDAO;
|
||||||
|
|
||||||
|
@Resource(name = "egovEnvPasswordEncoderService")
|
||||||
|
EgovPasswordEncoder egovPasswordEncoder;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public DataApiResVO selectMemberJoiningInfo(DataApiReqVO reqVO) {
|
public DataApiResVO selectMemberJoiningInfo(DataApiReqVO reqVO) {
|
||||||
@ -21,10 +35,13 @@ public class MemberServiceImpl implements MemberService
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataApiResVO insertMemberInfo(DataApiReqVO reqVO) {
|
public void insertMemberInfo(NlibLoginVO vo) throws Exception {
|
||||||
return null;
|
String encodedText=null;
|
||||||
|
encodedText = egovPasswordEncoder.encryptPassword(vo.getUserPwd());
|
||||||
|
vo.setUserPwd(encodedText);
|
||||||
|
memberDAO.insertMemberInfo(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataApiResVO sendEmailForMemberJoining(DataApiReqVO reqVO) {
|
public DataApiResVO sendEmailForMemberJoining(DataApiReqVO reqVO) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -37,8 +54,8 @@ public class MemberServiceImpl implements MemberService
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataApiResVO changePassword(DataApiReqVO reqVO) {
|
public void changePassword(NlibLoginVO vo) throws Exception {
|
||||||
return null;
|
memberDAO.changePassword(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataApiResVO selectMemberInfo(DataApiReqVO reqVO) {
|
public DataApiResVO selectMemberInfo(DataApiReqVO reqVO) {
|
||||||
@ -53,5 +70,126 @@ public class MemberServiceImpl implements MemberService
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//핸드폰 인증번호 난수 생성
|
||||||
|
/**
|
||||||
|
* 전달된 파라미터에 맞게 난수를 생성한다
|
||||||
|
* @param len : 생성할 난수의 길이
|
||||||
|
* @param dupCd : 중복 허용 여부 (1: 중복허용, 2:중복제거)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String numberGen(int len, int dupCd ) {
|
||||||
|
|
||||||
|
Random rand = new Random();
|
||||||
|
String numStr = ""; //난수가 저장될 변수
|
||||||
|
|
||||||
|
for(int i=0;i<len;i++) {
|
||||||
|
|
||||||
|
//0~9 까지 난수 생성
|
||||||
|
String ran = Integer.toString(rand.nextInt(10));
|
||||||
|
|
||||||
|
if(dupCd==1) {
|
||||||
|
//중복 허용시 numStr에 append
|
||||||
|
numStr += ran;
|
||||||
|
}else if(dupCd==2) {
|
||||||
|
//중복을 허용하지 않을시 중복된 값이 있는지 검사한다
|
||||||
|
if(!numStr.contains(ran)) {
|
||||||
|
//중복된 값이 없으면 numStr에 append
|
||||||
|
numStr += ran;
|
||||||
|
}else {
|
||||||
|
//생성된 난수가 중복되면 루틴을 다시 실행한다
|
||||||
|
i-=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return numStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 초기화 비밀번호 랜덤생성
|
||||||
|
*/
|
||||||
|
public String createInitPwd() {
|
||||||
|
// 비밀번호 자리수
|
||||||
|
int pwLength=16;
|
||||||
|
|
||||||
|
String dummyPW="";
|
||||||
|
List<String> dummylist=new ArrayList<String>();
|
||||||
|
|
||||||
|
// 대문자사용 1
|
||||||
|
int useU = 1;
|
||||||
|
String upperStr="";
|
||||||
|
|
||||||
|
// 소문자 사용 1
|
||||||
|
int useL = 1;
|
||||||
|
String lowerStr="";
|
||||||
|
|
||||||
|
// 숫자 사용 1
|
||||||
|
int useN = 1;
|
||||||
|
String ranNumberStr="";
|
||||||
|
|
||||||
|
// 특수문자 사용 1
|
||||||
|
int useS = 1;
|
||||||
|
String ranSkeyStr="";
|
||||||
|
|
||||||
|
// 사용할 특수문자
|
||||||
|
String specialKey="!=#$+@%*";
|
||||||
|
|
||||||
|
// 제외시킬 대,소문자(비슷하게 생긴것들)
|
||||||
|
String exceptionKey="IOiol";
|
||||||
|
|
||||||
|
char upperChar;
|
||||||
|
char lowerChar;
|
||||||
|
char ranSkey;
|
||||||
|
int startSkey;
|
||||||
|
int ranNumber;
|
||||||
|
int whileNum = 0;
|
||||||
|
boolean whileFlag = true;
|
||||||
|
|
||||||
|
do {
|
||||||
|
int loopNum=(int)(Math.random()*4);
|
||||||
|
// 대문자생성
|
||||||
|
if((whileFlag && upperStr.equals("1")) || (!whileFlag && useU == 1 && loopNum == 0)){
|
||||||
|
do {
|
||||||
|
upperChar = (char)(Math.random() * 26 + 65);
|
||||||
|
upperStr=String.valueOf(upperChar);
|
||||||
|
} while (exceptionKey.indexOf(upperStr)!=-1);
|
||||||
|
dummylist.add(upperStr);
|
||||||
|
whileNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 소문자생성
|
||||||
|
if((whileFlag && lowerStr.equals("1")) || (!whileFlag && useL == 1 && loopNum == 1)){
|
||||||
|
do {
|
||||||
|
lowerChar = (char)(Math.random() * 26 + 97);
|
||||||
|
lowerStr=String.valueOf(lowerChar);
|
||||||
|
} while (exceptionKey.indexOf(lowerStr)!=-1);
|
||||||
|
dummylist.add(lowerStr);
|
||||||
|
whileNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 숫자생성(숫자 0,1 제외)
|
||||||
|
if((whileFlag && ranNumberStr.equals("1")) || (!whileFlag && useN == 1 && loopNum == 2)){
|
||||||
|
ranNumber=(int)(Math.random() * 8 + 2);
|
||||||
|
ranNumberStr=String.valueOf(ranNumber);
|
||||||
|
dummylist.add(ranNumberStr);
|
||||||
|
whileNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 특수문자생성
|
||||||
|
if((whileFlag && ranSkeyStr.equals("1")) || (!whileFlag && useS == 1 && loopNum == 3)){
|
||||||
|
startSkey=(int)(Math.random()* (specialKey.length()-1))+1;
|
||||||
|
ranSkey=specialKey.charAt(startSkey);
|
||||||
|
ranSkeyStr=String.valueOf(ranSkey);
|
||||||
|
dummylist.add(ranSkeyStr);
|
||||||
|
whileNum++;
|
||||||
|
}
|
||||||
|
whileFlag = false;
|
||||||
|
} while (whileNum<pwLength);
|
||||||
|
// 섞기
|
||||||
|
Collections.shuffle(dummylist);
|
||||||
|
for (String string : dummylist) {
|
||||||
|
dummyPW+=string;
|
||||||
|
}
|
||||||
|
return dummyPW;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
12
src/main/java/nlib/user/service/impl/UserInfoDAO.java
Normal file
12
src/main/java/nlib/user/service/impl/UserInfoDAO.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package nlib.user.service.impl;
|
||||||
|
|
||||||
|
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||||
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
|
||||||
|
@Mapper("userInfoDAO")
|
||||||
|
public interface UserInfoDAO
|
||||||
|
{
|
||||||
|
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception;
|
||||||
|
|
||||||
|
public void updateMyInfo(NlibLoginVO vo) throws Exception;
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package nlib.user.service.impl;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
|
||||||
|
import nlib.user.service.MemberService;
|
||||||
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
import nlib.user.service.UserInfoService;
|
||||||
|
|
||||||
|
@Service("userInfoService")
|
||||||
|
public class UserInfoServiceImpl implements UserInfoService
|
||||||
|
{
|
||||||
|
@Resource(name="userInfoDAO")
|
||||||
|
private UserInfoDAO userInfoDAO;
|
||||||
|
|
||||||
|
@Resource(name = "egovEnvPasswordEncoderService")
|
||||||
|
EgovPasswordEncoder egovPasswordEncoder;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception {
|
||||||
|
return userInfoDAO.selectMyInfo(vo);
|
||||||
|
}
|
||||||
|
public void updateMyInfo(NlibLoginVO vo) throws Exception {
|
||||||
|
userInfoDAO.updateMyInfo(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,6 +9,7 @@ import java.nio.file.Files;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -50,14 +51,19 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||||
import com.github.scribejava.core.model.OAuth2AccessToken;
|
import com.github.scribejava.core.model.OAuth2AccessToken;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
|
||||||
import nlib.cmm.snslogin.GoogleOAuthResponse;
|
import nlib.cmm.snslogin.GoogleOAuthResponse;
|
||||||
import nlib.cmm.snslogin.KakaoController;
|
import nlib.cmm.snslogin.KakaoController;
|
||||||
import nlib.cmm.snslogin.NaverLoginBO;
|
import nlib.cmm.snslogin.NaverLoginBO;
|
||||||
import nlib.info.service.InformService;
|
import nlib.info.service.InformService;
|
||||||
|
import nlib.mail.EmailSender;
|
||||||
|
import nlib.mail.service.EmailVO;
|
||||||
import nlib.restful.service.DataApiReqVO;
|
import nlib.restful.service.DataApiReqVO;
|
||||||
import nlib.restful.service.DataApiResVO;
|
|
||||||
import nlib.user.service.MemberService;
|
import nlib.user.service.MemberService;
|
||||||
import nlib.user.service.NlibLoginVO;
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
import nlib.user.service.UserInfoService;
|
||||||
|
|
||||||
|
import org.springframework.mail.javamail.JavaMailSender;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -84,12 +90,19 @@ import nlib.user.service.NlibLoginVO;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class MemberController {
|
public class MemberController {
|
||||||
|
|
||||||
|
@Resource(name="userInfoService")
|
||||||
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
@Resource(name="memberService")
|
@Resource(name="memberService")
|
||||||
private MemberService memberService;
|
private MemberService memberService;
|
||||||
|
|
||||||
@Resource(name="informService")
|
@Resource(name="informService")
|
||||||
private InformService informService;
|
private InformService informService;
|
||||||
|
|
||||||
|
@Resource(name = "egovEnvPasswordEncoderService")
|
||||||
|
EgovPasswordEncoder egovPasswordEncoder;
|
||||||
|
|
||||||
/* NaverLoginBO */
|
/* NaverLoginBO */
|
||||||
private NaverLoginBO naverLoginBO;
|
private NaverLoginBO naverLoginBO;
|
||||||
private String apiResult = null;
|
private String apiResult = null;
|
||||||
@ -99,11 +112,17 @@ public class MemberController {
|
|||||||
this.naverLoginBO = naverLoginBO;
|
this.naverLoginBO = naverLoginBO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmailSender emailSender;
|
||||||
|
|
||||||
/* 이메일 메시지 및 템플릿 정보 */
|
/* 이메일 메시지 및 템플릿 정보 */
|
||||||
//템플릿 파일경로
|
//템플릿 파일경로
|
||||||
@Value("#{properties['mailing.sender.membership.template']}")
|
@Value("#{properties['mailing.sender.membership.template']}")
|
||||||
private String template;
|
private String template;
|
||||||
|
|
||||||
|
@Value("#{properties['mailing.sender.membership.pwdTemplate']}")
|
||||||
|
private String pwdTemplate;
|
||||||
|
|
||||||
//보내는 사람 이메일주소
|
//보내는 사람 이메일주소
|
||||||
@Value("#{properties['mailing.sender.membership.email']}")
|
@Value("#{properties['mailing.sender.membership.email']}")
|
||||||
private String senderAddr;
|
private String senderAddr;
|
||||||
@ -112,6 +131,11 @@ public class MemberController {
|
|||||||
@Value("#{properties['mailing.sender.membership.name']}")
|
@Value("#{properties['mailing.sender.membership.name']}")
|
||||||
private String senderName;
|
private String senderName;
|
||||||
|
|
||||||
|
//게스트 USERID
|
||||||
|
@Value("#{properties['guest.userid']}")
|
||||||
|
private String gUserId;
|
||||||
|
|
||||||
|
|
||||||
public ModelMap certificateMember(HttpServletRequest req) {
|
public ModelMap certificateMember(HttpServletRequest req) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -167,28 +191,32 @@ public class MemberController {
|
|||||||
model.addAttribute("kakaoUrl", kakaoUrl);
|
model.addAttribute("kakaoUrl", kakaoUrl);
|
||||||
return "nlib/member/snsCertForm";
|
return "nlib/member/snsCertForm";
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 회원가입 폼
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
@RequestMapping(value="/member/insertMemberInfoForm.do")
|
@RequestMapping(value="/member/insertMemberInfoForm.do")
|
||||||
public String insertMemberInfoForm(HttpServletRequest request,NlibLoginVO vo,HttpSession session,ModelMap model ) throws Exception{
|
public String insertMemberInfoForm(HttpServletRequest request,NlibLoginVO vo,HttpSession session,ModelMap model ) throws Exception{
|
||||||
Map<String, ?> flashMap =RequestContextUtils.getInputFlashMap(request);
|
Map<String, ?> flashMap =RequestContextUtils.getInputFlashMap(request);
|
||||||
|
|
||||||
if(flashMap != null)
|
/*if(flashMap != null)
|
||||||
{
|
{
|
||||||
vo.setLoginUserId(String.valueOf(flashMap.get("email")));
|
vo.setLoginUserId(String.valueOf(flashMap.get("email")));
|
||||||
}else {
|
}else {
|
||||||
return "forward:/member/selectMemberJoiningInfo.do";
|
return "forward:/member/selectMemberJoiningInfo.do";
|
||||||
}
|
}*/
|
||||||
model.addAttribute("loginVO",vo);
|
model.addAttribute("loginVO",vo);
|
||||||
return "nlib/member/insertMemberInfoForm";
|
return "nlib/member/insertMemberInfoForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 회원가입
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
@RequestMapping(value="/member/insertMemberInfo.do")
|
@RequestMapping(value="/member/insertMemberInfo.do")
|
||||||
public String insertMemberInfo(@RequestParam HashMap<String, Object> commandMap ) throws Exception{
|
public String insertMemberInfo(NlibLoginVO vo) throws Exception{
|
||||||
DataApiReqVO reqVO = new DataApiReqVO();
|
//등록처리 요청 (data insert)
|
||||||
reqVO.setInfo(commandMap);
|
memberService.insertMemberInfo(vo);
|
||||||
|
|
||||||
// 통합시스템에 등록처리 요청 (data insert)
|
|
||||||
|
|
||||||
|
|
||||||
// 결과가 정상이면, 안내 메일 발송
|
// 결과가 정상이면, 안내 메일 발송
|
||||||
// > 템플릿파일에서 내용 mailing.sender.membership.template
|
// > 템플릿파일에서 내용 mailing.sender.membership.template
|
||||||
@ -207,7 +235,8 @@ public class MemberController {
|
|||||||
for(String readLine : list) {
|
for(String readLine : list) {
|
||||||
contents+=readLine;
|
contents+=readLine;
|
||||||
}
|
}
|
||||||
contents=contents.replaceAll("[$]\\{userName\\}","유종선");
|
/*contents=contents.replaceAll("[$]\\{userName\\}","유종선");*/
|
||||||
|
contents=contents.replace("${userName}","유종선");
|
||||||
System.out.println(contents);
|
System.out.println(contents);
|
||||||
return "nlib/member/insertMemberInfoResult";
|
return "nlib/member/insertMemberInfoResult";
|
||||||
}
|
}
|
||||||
@ -218,19 +247,19 @@ public class MemberController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value="/member/phoneCertNum.ajax" , method=RequestMethod.POST)
|
@RequestMapping(value="/member/phoneCertNum.ajax" , method=RequestMethod.POST)
|
||||||
public @ResponseBody void phoneCertNum(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
public @ResponseBody void phoneCertNum(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||||
String phone = request.getParameter("phone");
|
String telNo = request.getParameter("telNo");
|
||||||
|
|
||||||
HashMap<String, Object> commandMap = new HashMap<String,Object>();
|
HashMap<String, Object> commandMap = new HashMap<String,Object>();
|
||||||
DataApiReqVO reqVO = new DataApiReqVO();
|
DataApiReqVO reqVO = new DataApiReqVO();
|
||||||
|
|
||||||
//인증번호
|
//인증번호 생성
|
||||||
String CertNumber=numberGen(6,1);
|
String CertNumber=memberService.numberGen(6,1);
|
||||||
|
|
||||||
commandMap.put("CertNumber",CertNumber);
|
commandMap.put("CertNumber",CertNumber);
|
||||||
|
|
||||||
reqVO.setInfo(commandMap);
|
reqVO.setInfo(commandMap);
|
||||||
|
|
||||||
System.out.println(phone);
|
System.out.println(telNo);
|
||||||
System.out.println(CertNumber);
|
System.out.println(CertNumber);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -257,68 +286,80 @@ public class MemberController {
|
|||||||
return "true";
|
return "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 전달된 파라미터에 맞게 난수를 생성한다
|
|
||||||
* @param len : 생성할 난수의 길이
|
|
||||||
* @param dupCd : 중복 허용 여부 (1: 중복허용, 2:중복제거)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public static String numberGen(int len, int dupCd ) {
|
|
||||||
|
|
||||||
Random rand = new Random();
|
|
||||||
String numStr = ""; //난수가 저장될 변수
|
|
||||||
|
|
||||||
for(int i=0;i<len;i++) {
|
|
||||||
|
|
||||||
//0~9 까지 난수 생성
|
|
||||||
String ran = Integer.toString(rand.nextInt(10));
|
|
||||||
|
|
||||||
if(dupCd==1) {
|
|
||||||
//중복 허용시 numStr에 append
|
|
||||||
numStr += ran;
|
|
||||||
}else if(dupCd==2) {
|
|
||||||
//중복을 허용하지 않을시 중복된 값이 있는지 검사한다
|
|
||||||
if(!numStr.contains(ran)) {
|
|
||||||
//중복된 값이 없으면 numStr에 append
|
|
||||||
numStr += ran;
|
|
||||||
}else {
|
|
||||||
//생성된 난수가 중복되면 루틴을 다시 실행한다
|
|
||||||
i-=1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return numStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID|비밀번호찾기 폼
|
* 비밀번호초기화 폼
|
||||||
* @exception Exception
|
* @exception Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/member/searchIdForm.do")
|
@RequestMapping(value="/member/initPasswordForm.do")
|
||||||
public String searchIdForm(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
public String searchIdForm(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||||
|
|
||||||
return "nlib/member/searchIdForm";
|
return "nlib/member/initPasswordForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID 찾기
|
* 비밀번호 초기화
|
||||||
* @exception Exception
|
* @exception Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/member/searchId.do")
|
@RequestMapping(value="/member/initPassword.ajax")
|
||||||
public String searchId(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
public @ResponseBody String initPassword(NlibLoginVO vo,HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{
|
||||||
System.out.println(request.getAttribute("name"));
|
|
||||||
System.out.println(request.getAttribute("searchIdPhoneNum"));
|
NlibLoginVO loginVO =userInfoService.selectMyInfo(vo);
|
||||||
return "nlib/member/searchIdResult";
|
|
||||||
}
|
EmailVO email = new EmailVO();
|
||||||
/**
|
|
||||||
* 비밀번호 찾기
|
String message = null;
|
||||||
* @exception Exception
|
|
||||||
*/
|
//비밀번호 초기화 변수 생성
|
||||||
@RequestMapping(value="/member/initPassword.do")
|
String InitPwd=memberService.createInitPwd();
|
||||||
public String initPassword(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
|
||||||
System.out.println(request.getAttribute("username"));
|
String encodedText=null;
|
||||||
System.out.println(request.getAttribute("initPasswordPhoneNum"));
|
|
||||||
return "nlib/member/initPassword";
|
//ID와 핸드폰 번호가 일치하는지 확인
|
||||||
|
if(loginVO!=null && (loginVO.getTelNo().equals(vo.getTelNo()) && loginVO.getLoginUserId().equals(vo.getLoginUserId())))
|
||||||
|
{
|
||||||
|
String reciver = vo.getLoginUserId(); //받을사람의 이메일입니다.-> naver nate 등등
|
||||||
|
String subject = "온라인자료대출시스템 비밀번호 초기화 메일입니다.";
|
||||||
|
|
||||||
|
|
||||||
|
// 결과가 정상이면, 안내 메일 발송
|
||||||
|
// > 템플릿파일에서 내용 mailing.sender.membership.pwdtemplate
|
||||||
|
// > 치환 (사용자명, 이메일주소)
|
||||||
|
// > 발송처리 요청
|
||||||
|
Path path = Paths.get(pwdTemplate);
|
||||||
|
Charset cs = StandardCharsets.UTF_8;
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
String contents = "";
|
||||||
|
try {
|
||||||
|
list = Files.readAllLines(path,cs);
|
||||||
|
}catch(IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
for(String readLine : list) {
|
||||||
|
contents+=readLine;
|
||||||
|
}
|
||||||
|
contents=contents.replace("${userPwd}",InitPwd);
|
||||||
|
|
||||||
|
email.setReciver(reciver);
|
||||||
|
|
||||||
|
email.setSubject(subject);
|
||||||
|
email.setContent(contents);
|
||||||
|
emailSender.SendEmail(email);
|
||||||
|
|
||||||
|
encodedText = egovPasswordEncoder.encryptPassword(InitPwd);
|
||||||
|
vo.setUserPwd(encodedText);
|
||||||
|
|
||||||
|
vo.setUserId(gUserId);
|
||||||
|
|
||||||
|
//암호화된 비밀번호로 수정
|
||||||
|
memberService.changePassword(vo);
|
||||||
|
|
||||||
|
message="초기화된 비밀번호가 이메일로 발송됐습니다.";
|
||||||
|
}else {
|
||||||
|
message="일치하는 아이디가 없습니다.";
|
||||||
|
}
|
||||||
|
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -382,7 +423,7 @@ public class MemberController {
|
|||||||
// Token Request
|
// Token Request
|
||||||
GoogleOAuthResponse result = mapper.readValue(resultEntity.getBody(), new TypeReference<GoogleOAuthResponse>() {
|
GoogleOAuthResponse result = mapper.readValue(resultEntity.getBody(), new TypeReference<GoogleOAuthResponse>() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// ID Token만 추출 (사용자의 정보는 jwt로 인코딩 되어있다)
|
// ID Token만 추출 (사용자의 정보는 jwt로 인코딩 되어있다)
|
||||||
String jwtToken = result.getIdToken();
|
String jwtToken = result.getIdToken();
|
||||||
String requestUrl = UriComponentsBuilder.fromHttpUrl("https://oauth2.googleapis.com/tokeninfo")
|
String requestUrl = UriComponentsBuilder.fromHttpUrl("https://oauth2.googleapis.com/tokeninfo")
|
||||||
@ -443,4 +484,20 @@ public class MemberController {
|
|||||||
rttr.addFlashAttribute("email",kemail);
|
rttr.addFlashAttribute("email",kemail);
|
||||||
return "redirect:/member/insertMemberInfoForm.do";
|
return "redirect:/member/insertMemberInfoForm.do";
|
||||||
}// end kakaoLogin()
|
}// end kakaoLogin()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 주소검색 팝업
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @param session
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/popup/jusoPopup.do")
|
||||||
|
public String jusoPopup(HttpServletRequest request, HttpServletResponse response, HttpSession session)
|
||||||
|
throws Exception {
|
||||||
|
|
||||||
|
return "nlib/popup/jusoPopup";
|
||||||
|
}// end kakaoLogin()
|
||||||
|
|
||||||
}
|
}
|
||||||
112
src/main/java/nlib/user/web/UserInfoController.java
Normal file
112
src/main/java/nlib/user/web/UserInfoController.java
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
|
||||||
|
package nlib.user.web;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
|
||||||
|
import nlib.restful.service.DataApiReqVO;
|
||||||
|
import nlib.security.SecUserVO;
|
||||||
|
import nlib.user.service.MemberService;
|
||||||
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
import nlib.user.service.UserInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* @Class Name : userInfoController.java
|
||||||
|
*
|
||||||
|
* @Description : 회원 정보 controller
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @ ------------ -------- ---------------------------
|
||||||
|
* @ 수정일 수정자 수정내용
|
||||||
|
* @ ------------ -------- ---------------------------
|
||||||
|
* @ 2021. 7. 14. JSYOO 최초 생성
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
||||||
|
* @since 2021. 7. 14.
|
||||||
|
* @version 1.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
public class UserInfoController {
|
||||||
|
|
||||||
|
@Resource(name="userInfoService")
|
||||||
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
|
@Resource(name = "egovEnvPasswordEncoderService")
|
||||||
|
EgovPasswordEncoder egovPasswordEncoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 내 정보 조회
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/userInfo/getMyInfo.do")
|
||||||
|
public String getMyInfo(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||||
|
return "nlib/userInfo/getMyInfo";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 내 정보 수정 페이지
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/userInfo/putMyInfo.do")
|
||||||
|
public String putMyInfo(NlibLoginVO vo,HttpServletResponse response,HttpServletRequest request,Authentication authentication,ModelMap model) throws Exception{
|
||||||
|
NlibLoginVO loginVO =userInfoService.selectMyInfo(vo);
|
||||||
|
|
||||||
|
String encodedText=null;
|
||||||
|
encodedText = egovPasswordEncoder.encryptPassword(vo.getUserPwd());
|
||||||
|
vo.setUserPwd(encodedText);
|
||||||
|
|
||||||
|
//암호화된 패스워드 비교
|
||||||
|
if(loginVO.getUserPwd().equals(vo.getUserPwd())) {
|
||||||
|
model.addAttribute("loginVO",loginVO);
|
||||||
|
return "nlib/userInfo/putMyInfo";
|
||||||
|
}else {
|
||||||
|
String message="비밀번호가 잘못되었습니다.";
|
||||||
|
model.addAttribute("message",message);
|
||||||
|
return "nlib/userInfo/pwCertMyInfo";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 내 정보 수정
|
||||||
|
* @return
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/userInfo/updateMyInfo.ajax" , method=RequestMethod.POST)
|
||||||
|
public @ResponseBody void updateMyInfo(NlibLoginVO vo,HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||||
|
|
||||||
|
String encodedText=null;
|
||||||
|
encodedText = egovPasswordEncoder.encryptPassword(vo.getUserPwd());
|
||||||
|
vo.setUserPwd(encodedText);
|
||||||
|
|
||||||
|
userInfoService.updateMyInfo(vo);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 내 정보 수정 전 password 인증
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/userInfo/pwCertMyInfo.do")
|
||||||
|
public String pwCertMyInfo(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||||
|
|
||||||
|
return "nlib/userInfo/pwCertMyInfo";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,77 +0,0 @@
|
|||||||
|
|
||||||
package nlib.user.web;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.springframework.security.core.Authentication;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.ModelMap;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
|
|
||||||
import nlib.restful.service.DataApiReqVO;
|
|
||||||
import nlib.security.SecUserVO;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <pre>
|
|
||||||
* @Class Name : userInfoController.java
|
|
||||||
*
|
|
||||||
* @Description : 회원 정보 controller
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 수정일 수정자 수정내용
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 2021. 7. 14. JSYOO 최초 생성
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
|
||||||
* @since 2021. 7. 14.
|
|
||||||
* @version 1.0
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Controller
|
|
||||||
public class userInfoController {
|
|
||||||
/**
|
|
||||||
* 내 정보 조회
|
|
||||||
* @exception Exception
|
|
||||||
*/
|
|
||||||
@RequestMapping(value="/userInfo/getMyInfo.do")
|
|
||||||
public String getMyInfo(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
|
||||||
return "nlib/userInfo/getMyInfo";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 내 정보 수정
|
|
||||||
* @exception Exception
|
|
||||||
*/
|
|
||||||
@RequestMapping(value="/userInfo/putMyInfo.do")
|
|
||||||
public String putMyInfo(HttpServletResponse response,HttpServletRequest request,Authentication authentication,ModelMap model) throws Exception{
|
|
||||||
SecUserVO vo=(SecUserVO) authentication.getPrincipal();
|
|
||||||
|
|
||||||
HashMap map = new HashMap();
|
|
||||||
map.put("id", vo.getUserId());
|
|
||||||
|
|
||||||
//회원 ID로 회원의 정보를 조회해온다.
|
|
||||||
DataApiReqVO reqvo=new DataApiReqVO();
|
|
||||||
reqvo.setInfo(map);
|
|
||||||
|
|
||||||
model.addAttribute("result",vo);
|
|
||||||
return "nlib/userInfo/putMyInfo";
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 내 정보 수정 전 password 인증
|
|
||||||
* @exception Exception
|
|
||||||
*/
|
|
||||||
@RequestMapping(value="/userInfo/pwCertMyInfo.do")
|
|
||||||
public String pwCertMyInfo(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
|
||||||
return "nlib/userInfo/pwCertMyInfo";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Wed May 11 15:49:38 KST 2016-->
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="nlib.user.service.impl.MemberDAO">
|
||||||
|
<resultMap type="nlib.user.service.NlibLoginVO" id="NlibLoginVO">
|
||||||
|
<result column="USER_ID" property="userId"/>
|
||||||
|
<result column="LOGIN_USER_ID" property="loginUserId"/>
|
||||||
|
<result column="USER_DIV" property="userDiv"/>
|
||||||
|
<result column="USER_NM" property="userNm"/>
|
||||||
|
<result column="USER_PWD" property="userPwd"/>
|
||||||
|
<result column="BIRTHDATE" property="birthdate"/>
|
||||||
|
<result column="GENDER" property="gender"/>
|
||||||
|
<result column="REG_ID" property="regId"/>
|
||||||
|
<result column="MOD_ID" property="modId"/>
|
||||||
|
<result column="TEL_NO" property="telNo"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertMemberInfo" parameterType="nlib.user.service.NlibLoginVO">
|
||||||
|
<selectKey resultType="string" keyProperty="userId" order="BEFORE">
|
||||||
|
SELECT CONCAT(LEFT(MAX(USER_ID),2),
|
||||||
|
LPAD(RIGHT(MAX(USER_ID),9)+1,9,0)) FROM TMP_SM_USER;
|
||||||
|
</selectKey>
|
||||||
|
INSERT INTO
|
||||||
|
TMP_SM_USER
|
||||||
|
(USER_ID,LOGIN_USER_ID,USER_DIV,USER_NM,USER_PWD,BIRTHDATE,GENDER,TEL_NO,ZIPCODE,ADDR1,ADDR2,REG_ID,MOD_ID)
|
||||||
|
VALUES
|
||||||
|
(#{userId},#{loginUserId},'N',#{userNm},#{userPwd},#{birthdate},#{gender},#{telNo},#{zipcode},#{addr1},#{addr2},#{userId},#{userId})
|
||||||
|
</insert>
|
||||||
|
<update id="changePassword" parameterType="nlib.user.service.NlibLoginVO">
|
||||||
|
UPDATE
|
||||||
|
TMP_SM_USER
|
||||||
|
SET
|
||||||
|
USER_PWD=#{userPwd}
|
||||||
|
,MOD_ID = #{userId}
|
||||||
|
,MOD_DD = SYSDATE()
|
||||||
|
|
||||||
|
WHERE 1=1
|
||||||
|
AND LOGIN_USER_ID = #{loginUserId}
|
||||||
|
AND TEL_NO = #{telNo}
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Wed May 11 15:49:38 KST 2016-->
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="nlib.user.service.impl.UserInfoDAO">
|
||||||
|
<resultMap type="nlib.user.service.NlibLoginVO" id="NlibLoginVO">
|
||||||
|
<result column="USER_ID" property="userId"/>
|
||||||
|
<result column="LOGIN_USER_ID" property="loginUserId"/>
|
||||||
|
<result column="USER_DIV" property="userDiv"/>
|
||||||
|
<result column="USER_NM" property="userNm"/>
|
||||||
|
<result column="USER_PWD" property="userPwd"/>
|
||||||
|
<result column="BIRTHDATE" property="birthdate"/>
|
||||||
|
<result column="TEL_NO" property="telNo"/>
|
||||||
|
<result column="ZIPCODE" property="zipcode"/>
|
||||||
|
<result column="ADDR1" property="addr1"/>
|
||||||
|
<result column="ADDR2" property="addr2"/>
|
||||||
|
<result column="GENDER" property="gender"/>
|
||||||
|
<result column="REG_ID" property="regId"/>
|
||||||
|
<result column="MOD_ID" property="modId"/>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectMyInfo" parameterType="nlib.user.service.NlibLoginVO" resultMap="NlibLoginVO">
|
||||||
|
SELECT
|
||||||
|
USER_ID
|
||||||
|
,LOGIN_USER_ID
|
||||||
|
,USER_NM
|
||||||
|
,USER_PWD
|
||||||
|
,BIRTHDATE
|
||||||
|
,GENDER
|
||||||
|
,TEL_NO
|
||||||
|
,ZIPCODE
|
||||||
|
,ADDR1
|
||||||
|
,ADDR2
|
||||||
|
FROM
|
||||||
|
TMP_SM_USER
|
||||||
|
WHERE 1=1
|
||||||
|
AND USER_ID="U2000000003"
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateMyInfo" parameterType="nlib.user.service.NlibLoginVO">
|
||||||
|
UPDATE
|
||||||
|
TMP_SM_USER
|
||||||
|
SET
|
||||||
|
USER_NM=#{userNm}
|
||||||
|
,USER_PWD=#{userPwd}
|
||||||
|
,BIRTHDATE=#{birthdate}
|
||||||
|
,GENDER=#{gender}
|
||||||
|
,TEL_NO=#{telNo}
|
||||||
|
,ZIPCODE=#{zipcode}
|
||||||
|
,ADDR1=#{addr1}
|
||||||
|
,ADDR2=#{addr2}
|
||||||
|
WHERE 1=1
|
||||||
|
AND USER_ID="U2000000003"
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
23
src/main/resources/egovframework/spring/context-mail.xml
Normal file
23
src/main/resources/egovframework/spring/context-mail.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:p="http://www.springframework.org/schema/p"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">
|
||||||
|
|
||||||
|
<!-- 이메일 발송 -->
|
||||||
|
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"
|
||||||
|
p:host="smtp.gmail.com"
|
||||||
|
p:port="587"
|
||||||
|
p:protocol="smtp"
|
||||||
|
p:username="siasia0824@gmail.com"
|
||||||
|
p:password="whdtjs!234">
|
||||||
|
<property name="javaMailProperties">
|
||||||
|
<props>
|
||||||
|
<prop key="mail.smtp.starttls.enable">true</prop>
|
||||||
|
<prop key="mail.smtp.auth">true </prop>
|
||||||
|
<prop key="mail.debug">true</prop>
|
||||||
|
<prop key="mail.smtp.ssl.trust">smtp.gmail.com</prop>
|
||||||
|
<prop key="mail.smtp.ssl.protocols">TLSv1.2</prop>
|
||||||
|
</props>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
</beans>
|
||||||
@ -55,6 +55,8 @@ fileupload.bbs.qna.subpath = /bbs/qna
|
|||||||
# \uba54\uc77c \uacbd\ub85c
|
# \uba54\uc77c \uacbd\ub85c
|
||||||
mailing.sender.membership.template = C:/iams/workspace/nlib/src/main/webapp/mail/mail_template.html
|
mailing.sender.membership.template = C:/iams/workspace/nlib/src/main/webapp/mail/mail_template.html
|
||||||
|
|
||||||
|
mailing.sender.membership.pwdTemplate = C:/iams/workspace/nlib/src/main/webapp/mail/pwd_mail_template.html
|
||||||
|
|
||||||
#\uba54\uc77c \ubcf4\ub0b4\ub294 \uc8fc\uc18c
|
#\uba54\uc77c \ubcf4\ub0b4\ub294 \uc8fc\uc18c
|
||||||
mailing.sender.membership.email = no-reply@nlib.org
|
mailing.sender.membership.email = no-reply@nlib.org
|
||||||
|
|
||||||
@ -91,3 +93,8 @@ oauth2.client.provider.naver.token-uri = https://nid.naver.com/oauth2.0/token
|
|||||||
oauth2.client.provider.naver.user-info-uri = https://openapi.naver.com/v1/nid/me
|
oauth2.client.provider.naver.user-info-uri = https://openapi.naver.com/v1/nid/me
|
||||||
oauth2.client.provider.naver.user-name-attribute = response
|
oauth2.client.provider.naver.user-name-attribute = response
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------
|
||||||
|
# \uc190\ub2d8\uc815\ubcf4
|
||||||
|
#----------------------------------------
|
||||||
|
guest.userid = GUEST
|
||||||
|
|||||||
@ -40,10 +40,10 @@
|
|||||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function signUp(){
|
function signUp(){
|
||||||
location.href="/nlib/member/selectMemberJoiningInfo.do";
|
location.href="${pageContext.request.contextPath}/member/selectMemberJoiningInfo.do";
|
||||||
}
|
}
|
||||||
function findInfo(){
|
function findInfo(){
|
||||||
location.href="/nlib/member/searchIdForm.do";
|
location.href="${pageContext.request.contextPath}/member/initPasswordForm.do";
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
<br>
|
<br>
|
||||||
<div style="text-align:center">
|
<div style="text-align:center">
|
||||||
<input type="button" onclick="signUp();" value="회원가입">
|
<input type="button" onclick="signUp();" value="회원가입">
|
||||||
<input type="button" onclick="findInfo();" value="ID|비밀번호찾기">
|
<input type="button" onclick="findInfo();" value="비밀번호 초기화">
|
||||||
</div>
|
</div>
|
||||||
<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
|
<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
71
src/main/webapp/WEB-INF/jsp/nlib/member/initPasswordForm.jsp
Normal file
71
src/main/webapp/WEB-INF/jsp/nlib/member/initPasswordForm.jsp
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<%
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* @Class Name : initPasswordForm.jsp
|
||||||
|
*
|
||||||
|
* @Description : 비밀번호 초기화
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @ ------------ -------- ---------------------------
|
||||||
|
* @ 수정일 수정자 수정내용
|
||||||
|
* @ ------------ -------- ---------------------------
|
||||||
|
* @ 2021. 7. 12. JSYOO 최초 생성
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
||||||
|
* @since 2021. 7. 12.
|
||||||
|
* @version 1.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
%>
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||||
|
<script>
|
||||||
|
function goFindPw(){
|
||||||
|
$("#telNo").val($("#telNo").val().replace(/-/gi,""));
|
||||||
|
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
||||||
|
|
||||||
|
if(!regExp.test($("#telNo").val()) || $("#telNo").val()==""){
|
||||||
|
|
||||||
|
alert("형식에 맞지 않는 번호입니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = $("form[name=initPw]").serialize();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url : "/nlib/member/initPassword.ajax",
|
||||||
|
type : "POST",
|
||||||
|
data : data,
|
||||||
|
success : function(result){
|
||||||
|
|
||||||
|
alert(result);
|
||||||
|
location.href='${pageContext.request.contextPath}/login/loginForm.do';
|
||||||
|
|
||||||
|
},error : function(){
|
||||||
|
alert("이메일 발송에 실패하였습니다.");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="initPw" name="initPw" method="post">
|
||||||
|
<h1>비밀번호 찾기</h1>
|
||||||
|
<p>회원님의 본인확인을 위해 가입시 등록하신 이메일/휴대폰번호를 입력하여 주시기 바랍니다.</p><br>
|
||||||
|
Email <input type="text" id="loginUserId" name="loginUserId">
|
||||||
|
핸드폰 번호 <input type="text" id="telNo" name="telNo">
|
||||||
|
<input type="button" onclick ="goFindPw();" value="임시비밀번호 받기">
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -38,8 +38,8 @@
|
|||||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||||
<script type="text/javaScript" language="javascript" defer="defer">
|
<script type="text/javaScript" language="javascript" defer="defer">
|
||||||
function signUp(){
|
function signUp(){
|
||||||
var p = document.getElementById('password');
|
var p = document.getElementById('userPwd');
|
||||||
var p_cf = document.getElementById('passwordConfirm');
|
var p_cf = document.getElementById('userPwdConfirm');
|
||||||
|
|
||||||
if(p.value != p_cf.value)
|
if(p.value != p_cf.value)
|
||||||
{
|
{
|
||||||
@ -54,13 +54,18 @@ function signUp(){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($("#zipNo").val()=="" || $("#roadAddrPart").val()=="" || $("#addrDetail").val()=="")
|
if($("#zipcode").val()=="" || $("#addr1").val()=="" || $("#addr2").val()=="")
|
||||||
{
|
{
|
||||||
alert("주소를 입력해주세요.");
|
alert("주소를 입력해주세요.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(!checkBirthday())
|
||||||
|
{
|
||||||
|
alert("생년월일이 형식에 맞지 않습니다. 확인해주세요.");
|
||||||
|
}
|
||||||
|
|
||||||
if(confirm("회원가입하시겠습니까?")){
|
if(confirm("회원가입하시겠습니까?")){
|
||||||
|
$("#birthdate").val($("#birth_yy").val()+$("#birth_mm").val()+$("#birth_dd").val());
|
||||||
alert("회원가입 되었습니다.");
|
alert("회원가입 되었습니다.");
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
@ -79,20 +84,57 @@ $(document).ready(function() {
|
|||||||
<%
|
<%
|
||||||
//핸드폰 번호가 변하는것 실시간 감지
|
//핸드폰 번호가 변하는것 실시간 감지
|
||||||
%>
|
%>
|
||||||
$("#phone").on("propertychange change keyup paste input", function() {
|
$("#telNo").on("propertychange change keyup paste input", function() {
|
||||||
$("#phoneCertYn").val("N");
|
$("#phoneCertYn").val("N");
|
||||||
});
|
});
|
||||||
|
<%
|
||||||
|
//아이디가 변하는것 실시간 감지
|
||||||
|
%>
|
||||||
|
$("#loginUserId").on("propertychange change keyup paste input", function() {
|
||||||
|
$("#emailCertYn").val("N");
|
||||||
|
$("#getEmailCert").css("display","block")
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
<%
|
||||||
|
//이메일 인증
|
||||||
|
%>
|
||||||
|
function emailCert(){
|
||||||
|
|
||||||
|
|
||||||
|
$("#telNo").val($("#telNo").val().replace(/-/gi,""));
|
||||||
|
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
||||||
|
|
||||||
|
if(!regExp.test($("#telNo").val()) || $("#telNo").val()==""){
|
||||||
|
|
||||||
|
alert("형식에 맞지 않는 번호입니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url : "/nlib/member/phoneCertNum.ajax",
|
||||||
|
type : "POST",
|
||||||
|
async: false,
|
||||||
|
data : {"telNo" : $("#telNo").val()},
|
||||||
|
success : function(result){
|
||||||
|
alert("이메일 인증번호가 발송됐습니다.");
|
||||||
|
//인증번호 확인창
|
||||||
|
$("#emailCertForm").css("display","block")
|
||||||
|
|
||||||
|
},error : function(){
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
<%
|
<%
|
||||||
//핸드폰 인증번호 받기
|
//핸드폰 인증번호 받기
|
||||||
%>
|
%>
|
||||||
function phoneCert(){
|
function phoneCert(){
|
||||||
|
|
||||||
|
|
||||||
$("#phone").val($("#phone").val().replace(/-/gi,""));
|
$("#telNo").val($("#telNo").val().replace(/-/gi,""));
|
||||||
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
||||||
|
|
||||||
if(!regExp.test($("#phone").val()) || $("#phone").val()==""){
|
if(!regExp.test($("#telNo").val()) || $("#telNo").val()==""){
|
||||||
|
|
||||||
alert("형식에 맞지 않는 번호입니다.");
|
alert("형식에 맞지 않는 번호입니다.");
|
||||||
return false;
|
return false;
|
||||||
@ -102,7 +144,7 @@ function phoneCert(){
|
|||||||
url : "/nlib/member/phoneCertNum.ajax",
|
url : "/nlib/member/phoneCertNum.ajax",
|
||||||
type : "POST",
|
type : "POST",
|
||||||
async: false,
|
async: false,
|
||||||
data : {"phone" : $("#phone").val()},
|
data : {"telNo" : $("#telNo").val()},
|
||||||
success : function(result){
|
success : function(result){
|
||||||
alert("인증번호가 발송됐습니다.");
|
alert("인증번호가 발송됐습니다.");
|
||||||
//인증번호 확인창
|
//인증번호 확인창
|
||||||
@ -124,7 +166,7 @@ function certNumCheck(){
|
|||||||
url : "/nlib/member/phoneCertNumChk.ajax",
|
url : "/nlib/member/phoneCertNumChk.ajax",
|
||||||
type : "POST",
|
type : "POST",
|
||||||
data : {"phoneCertNum" : $("#phoneCertNum").val(),
|
data : {"phoneCertNum" : $("#phoneCertNum").val(),
|
||||||
"phone" : $("#phone").val()},
|
"telNo" : $("#telNo").val()},
|
||||||
async: false,
|
async: false,
|
||||||
success : function(result){
|
success : function(result){
|
||||||
if(result=="true")
|
if(result=="true")
|
||||||
@ -142,9 +184,9 @@ function certNumCheck(){
|
|||||||
|
|
||||||
function jusoCallBack(zipNo,roadAddrPart,addrDetail){
|
function jusoCallBack(zipNo,roadAddrPart,addrDetail){
|
||||||
// 팝업페이지에서 주소입력한 정보를 받아서, 현 페이지에 정보를 등록합니다.
|
// 팝업페이지에서 주소입력한 정보를 받아서, 현 페이지에 정보를 등록합니다.
|
||||||
$("#zipNo").val(zipNo);
|
$("#zipcode").val(zipNo);
|
||||||
$("#roadAddrPart").val(roadAddrPart);
|
$("#addr1").val(roadAddrPart);
|
||||||
$("#addrDetail").val(addrDetail);
|
$("#addr2").val(addrDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('keydown', function(event) {
|
document.addEventListener('keydown', function(event) {
|
||||||
@ -318,38 +360,28 @@ label.error {
|
|||||||
<tr>
|
<tr>
|
||||||
<td id="title">아이디</td>
|
<td id="title">아이디</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="email" id="id" name="id" maxlength="30" value=<c:out value="${loginVO.id}"/> required readonly >
|
<input type="email" id="loginUserId" name="loginUserId" maxlength="30" required value="<c:out value="${loginVO.loginUserId}"/>" ><button type="button" id="getEmailCert" name="getEmailCert" style="text-align:left;display:none;" class="btn-warning" onclick="emailCert()" required>인증번호 받기</button>
|
||||||
</td>
|
<div id="phoneCertForm" style="display:none;"><br><input type='text' id='phoneCertNum' name='phoneCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td id="title">비밀번호</td>
|
|
||||||
<td>
|
|
||||||
<input type="password" id="password" name="password" minlength="8" maxlength="16"
|
|
||||||
oninvalid="this.setCustomValidity('8~16자 영문 대 소문자, 숫자, 특수문자를 사용하세요.')"
|
|
||||||
oninput="this.setCustomValidity('')"
|
|
||||||
pattern="^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,16}$" required>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td id="title">비밀번호 확인</td>
|
|
||||||
<td>
|
|
||||||
<input type="password" id="passwordConfirm" name="passwordConfirm" minlength="8" maxlength="16" required>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td id="title">이름</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" id="name" name="name" maxlength="20" required value=<c:out value="${loginVO.name}"/> >
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td id="title">생일</td>
|
<td id="title">이름</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="userNm" name="userNm" maxlength="20" required >
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id="title">성별</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="birth_yy" name="birth_yy" maxlength="4" placeholder="년(4자)" required pattern="^(19|20)\d{2}$" value=<c:out value="${loginVO.birth_yy}"/> >
|
<input type="radio" name="gender" value="M" required>남자
|
||||||
<select id="birth_mm" name="birth_mm" value=<c:out value="${loginVO.birth_mm}"/> required>
|
<input type="radio" name="gender" value="F" required>여자
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id="title">생년월일</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="birth_yy" name="birth_yy" maxlength="4" placeholder="년(4자)" required>
|
||||||
|
<select id="birth_mm" name="birth_mm" required>
|
||||||
<option value="">월</option>
|
<option value="">월</option>
|
||||||
<option value="01" >1</option>
|
<option value="01" >1</option>
|
||||||
<option value="02" >2</option>
|
<option value="02" >2</option>
|
||||||
@ -364,28 +396,47 @@ label.error {
|
|||||||
<option value="11" >11</option>
|
<option value="11" >11</option>
|
||||||
<option value="12" >12</option>
|
<option value="12" >12</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" id="birth_dd" name="birth_dd" size="2" maxlength="2" placeholder="일" size="4" value=<c:out value="${loginVO.birth_dd}"/> required pattern="^(0[1-9]|[12][0-9]|3[0-1])$">
|
<input type="text" id="birth_dd" name="birth_dd" size="2" maxlength="2" placeholder="일" size="4" required>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id="title">비밀번호</td>
|
||||||
|
<td>
|
||||||
|
<input type="password" id="userPwd" name="userPwd" minlength="8" maxlength="16"
|
||||||
|
oninvalid="this.setCustomValidity('8~16자 영문 대 소문자, 숫자, 특수문자를 사용하세요.')"
|
||||||
|
oninput="this.setCustomValidity('')"
|
||||||
|
pattern="^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,16}$" required>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td id="title">비밀번호 확인</td>
|
||||||
|
<td>
|
||||||
|
<input type="password" id="userPwdConfirm" name="userPwdConfirm" minlength="8" maxlength="16" required>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td id="title">주소</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="zipcode" name="zipcode" ><button type="button" style="text-align:left;" class="btn-warning" onclick="goPopup()">주소검색</button><br>
|
||||||
|
<input type="text" id="addr1" name="addr1" ><input type="text" id="addr2" name="addr2" >
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td id="title">휴대전화</td>
|
<td id="title">휴대전화</td>
|
||||||
<td id="Cert">
|
<td id="Cert">
|
||||||
<input type="text" id="phone" name="phone" required value=<c:out value="${loginVO.phone}"/>><button type="button" style="text-align:left;" class="btn-warning" onclick="phoneCert()" required>인증번호 받기</button>
|
<input type="text" id="telNo" name="telNo" required ><button type="button" style="text-align:left;" class="btn-warning" onclick="phoneCert()" required>인증번호 받기</button>
|
||||||
<div id="phoneCertForm" style="display:none;"><br><input type='text' id='phoneCertNum' name='phoneCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
|
<div id="phoneCertForm" style="display:none;"><br><input type='text' id='phoneCertNum' name='phoneCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td id="title">주소</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" id="zipNo" name="zipNo" readonly ><button type="button" style="text-align:left;" class="btn-warning" onclick="goPopup()">주소검색</button><br>
|
|
||||||
<input type="text" id="roadAddrPart" name="roadAddrPart" readonly ><input type="text" id="addrDetail" name="addrDetail" readonly >
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
<input type="hidden" id="phoneCertYn" name="phoneCertYn" value=<c:out value="N"/>>
|
<input type="hidden" id="birthdate" name="birthdate" >
|
||||||
<input type="submit" value="가입"/> <input type="button" value="취소">
|
<input type="hidden" id="phoneCertYn" name="phoneCertYn" value="N">
|
||||||
|
<input type="hidden" id="emailCertYn" name="emailCertYn" value="Y">
|
||||||
|
<input type="submit" value="가입"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,76 +0,0 @@
|
|||||||
<%
|
|
||||||
/**
|
|
||||||
* <pre>
|
|
||||||
* @Class Name : searchIdForm.jsp
|
|
||||||
*
|
|
||||||
* @Description : ID 비밀번호 찾기
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 수정일 수정자 수정내용
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 2021. 7. 12. JSYOO 최초 생성
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
|
||||||
* @since 2021. 7. 12.
|
|
||||||
* @version 1.0
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
%>
|
|
||||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
||||||
pageEncoding="UTF-8"%>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
||||||
<title>Insert title here</title>
|
|
||||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
|
||||||
<script>
|
|
||||||
function goFindId(){
|
|
||||||
$("#searchIdPhoneNum").val($("#searchIdPhoneNum").val().replace(/-/gi,""));
|
|
||||||
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
|
||||||
|
|
||||||
if(!regExp.test($("#searchIdPhoneNum").val()) || $("#searchIdPhoneNum").val()==""){
|
|
||||||
|
|
||||||
alert("형식에 맞지 않는 번호입니다.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
document.findId.action="/nlib/member/searchId.do";
|
|
||||||
document.findId.submit();
|
|
||||||
}
|
|
||||||
function goFindPw(){
|
|
||||||
$("#initPasswordPhoneNum").val($("#initPasswordPhoneNum").val().replace(/-/gi,""));
|
|
||||||
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
|
||||||
|
|
||||||
if(!regExp.test($("#initPasswordPhoneNum").val()) || $("#initPasswordPhoneNum").val()==""){
|
|
||||||
|
|
||||||
alert("형식에 맞지 않는 번호입니다.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
document.findPw.action="/nlib/member/initPassword.do";
|
|
||||||
document.findPw.submit();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>아이디 찾기</h1>
|
|
||||||
<form id="findId" name="findId" method="post">
|
|
||||||
이름 <input type="text" id="name" name="name">
|
|
||||||
핸드폰 번호 <input type="text" id="searchIdPhoneNum" name="searchIdPhoneNum">
|
|
||||||
<input type="button" onclick ="goFindId();" value="아이디 찾기">
|
|
||||||
</form>
|
|
||||||
<form id="findPw" name="findPw" method="post">
|
|
||||||
<h1>비밀번호 찾기</h1>
|
|
||||||
ID <input type="text" id="username" name="username">
|
|
||||||
핸드폰 번호 <input type="text" id="initPasswordPhoneNum" name="initPasswordPhoneNum">
|
|
||||||
<input type="button" onclick ="goFindPw();" value="임시비밀번호 받기">
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
<%
|
|
||||||
/**
|
|
||||||
* <pre>
|
|
||||||
* @Class Name : searchIdResult.jsp
|
|
||||||
*
|
|
||||||
* @Description : 아이디 찾기 결과
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 수정일 수정자 수정내용
|
|
||||||
* @ ------------ -------- ---------------------------
|
|
||||||
* @ 2021. 7. 12. JSYOO 최초 생성
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
|
||||||
* @since 2021. 7. 12.
|
|
||||||
* @version 1.0
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
%>
|
|
||||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
||||||
pageEncoding="UTF-8"%>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
||||||
<title>Insert title here</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
아이디찾기 결과페이지
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
function snsCertForm(){
|
function snsCertForm(){
|
||||||
if(document.getElementById('agree').checked)
|
if(document.getElementById('agree').checked)
|
||||||
{
|
{
|
||||||
location.href="/nlib/member/snsCertForm.do";
|
location.href="${pageContext.request.contextPath}/member/snsCertForm.do";
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
alert("약관에 동의해주세요");
|
alert("약관에 동의해주세요");
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
var url = location.href;
|
var url = location.href;
|
||||||
var confmKey = "devU01TX0FVVEgyMDIxMDYzMDEwNTQyMDExMTM0MTg=";
|
var confmKey = "devU01TX0FVVEgyMDIxMDgxOTEwMTkxNjExMTU0MTU=";
|
||||||
var resultType = "4"; // 도로명주소 검색결과 화면 출력내용, 1 : 도로명, 2 : 도로명+지번, 3 : 도로명+상세건물명, 4 : 도로명+지번+상세건물명
|
var resultType = "4"; // 도로명주소 검색결과 화면 출력내용, 1 : 도로명, 2 : 도로명+지번, 3 : 도로명+상세건물명, 4 : 도로명+지번+상세건물명
|
||||||
var inputYn= "<%=inputYn%>";
|
var inputYn= "<%=inputYn%>";
|
||||||
if(inputYn != "Y"){
|
if(inputYn != "Y"){
|
||||||
|
|||||||
@ -37,6 +37,75 @@
|
|||||||
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
|
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
|
||||||
<title>Insert title here</title>
|
<title>Insert title here</title>
|
||||||
<script type="text/javaScript" language="javascript" defer="defer">
|
<script type="text/javaScript" language="javascript" defer="defer">
|
||||||
|
$(document).ready(function() {
|
||||||
|
<%
|
||||||
|
//핸드폰 번호가 변하는것 실시간 감지
|
||||||
|
%>
|
||||||
|
$("#telNo").on("propertychange change keyup paste input", function() {
|
||||||
|
$("#phoneCertYn").val("N");
|
||||||
|
});
|
||||||
|
$("input:radio[name='gender']:radio[value='${loginVO.gender}']").prop("checked",true);
|
||||||
|
|
||||||
|
var birthdate='${loginVO.birthdate}';
|
||||||
|
|
||||||
|
$("#birth_yy").val(birthdate.substr(0,4));
|
||||||
|
$("#birth_mm").val(birthdate.substr(4,2));
|
||||||
|
$("#birth_dd").val(birthdate.substr(6,2));
|
||||||
|
alert("22222 <c:out value="${loginVO.addr1}" escapeXml="false"/>");
|
||||||
|
})
|
||||||
|
|
||||||
|
function update(){
|
||||||
|
var p = document.getElementById('userPwd');
|
||||||
|
var p_cf = document.getElementById('userPwdConfirm');
|
||||||
|
|
||||||
|
if(p.value != p_cf.value)
|
||||||
|
{
|
||||||
|
alert("비밀번호가 일치하지 않습니다. 확인해 주세요.");
|
||||||
|
p_cf.focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!checkBirthday())
|
||||||
|
{
|
||||||
|
alert("생년월일이 형식에 맞지 않습니다. 확인해주세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if($("#phoneCertYn").val()!="Y")
|
||||||
|
{
|
||||||
|
alert("휴대전화 인증이 필요합니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($("#zipcode").val()=="" || $("#addr1").val()=="" || $("#addr2").val()=="")
|
||||||
|
{
|
||||||
|
alert("주소를 입력해주세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(confirm("정보를 수정하시겠습니까?")){
|
||||||
|
$("#birthdate").val($("#birth_yy").val()+$("#birth_mm").val()+$("#birth_dd").val());
|
||||||
|
|
||||||
|
var queryString = $("form[name=updateForm]").serialize() ;
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url : "${pageContext.request.contextPath}/userInfo/updateMyInfo.ajax",
|
||||||
|
type : "POST",
|
||||||
|
async: false,
|
||||||
|
data : queryString,
|
||||||
|
success : function(result){
|
||||||
|
alert("정보를 수정하였습니다.");
|
||||||
|
//인증번호 확인창
|
||||||
|
location.replace("${pageContext.request.contextPath}/userInfo/getMyInfo.do");
|
||||||
|
},error : function(){
|
||||||
|
alert("정보 수정에 실패하였습니다.");
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function goPopup(){
|
function goPopup(){
|
||||||
// 주소검색을 수행할 팝업 페이지를 호출합니다.
|
// 주소검색을 수행할 팝업 페이지를 호출합니다.
|
||||||
// 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrLinkUrl.do)를 호출하게 됩니다.
|
// 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrLinkUrl.do)를 호출하게 됩니다.
|
||||||
@ -45,24 +114,17 @@ function goPopup(){
|
|||||||
// 모바일 웹인 경우, 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrMobileLinkUrl.do)를 호출하게 됩니다.
|
// 모바일 웹인 경우, 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrMobileLinkUrl.do)를 호출하게 됩니다.
|
||||||
//var pop = window.open("/popup/jusoPopup.jsp","pop","scrollbars=yes, resizable=yes");
|
//var pop = window.open("/popup/jusoPopup.jsp","pop","scrollbars=yes, resizable=yes");
|
||||||
}
|
}
|
||||||
$(document).ready(function() {
|
|
||||||
<%
|
|
||||||
//핸드폰 번호가 변하는것 실시간 감지
|
|
||||||
%>
|
|
||||||
$("#phone").on("propertychange change keyup paste input", function() {
|
|
||||||
$("#phoneCertYn").val("N");
|
|
||||||
});
|
|
||||||
})
|
|
||||||
<%
|
<%
|
||||||
//핸드폰 인증번호 받기
|
//핸드폰 인증번호 받기
|
||||||
%>
|
%>
|
||||||
function phoneCert(){
|
function phoneCert(){
|
||||||
|
|
||||||
|
|
||||||
$("#phone").val($("#phone").val().replace(/-/gi,""));
|
$("#telNo").val($("#telNo").val().replace(/-/gi,""));
|
||||||
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
var regExp = /^\d{3}\d{3,4}\d{4}$/;
|
||||||
|
|
||||||
if(!regExp.test($("#phone").val()) || $("#phone").val()==""){
|
if(!regExp.test($("#telNo").val()) || $("#telNo").val()==""){
|
||||||
|
|
||||||
alert("형식에 맞지 않는 번호입니다.");
|
alert("형식에 맞지 않는 번호입니다.");
|
||||||
return false;
|
return false;
|
||||||
@ -72,7 +134,7 @@ function phoneCert(){
|
|||||||
url : "/nlib/member/phoneCertNum.ajax",
|
url : "/nlib/member/phoneCertNum.ajax",
|
||||||
type : "POST",
|
type : "POST",
|
||||||
async: false,
|
async: false,
|
||||||
data : {"phone" : $("#phone").val()},
|
data : {"telNo" : $("#telNo").val()},
|
||||||
success : function(result){
|
success : function(result){
|
||||||
alert("인증번호가 발송됐습니다.");
|
alert("인증번호가 발송됐습니다.");
|
||||||
//인증번호 확인창
|
//인증번호 확인창
|
||||||
@ -94,7 +156,7 @@ function certNumCheck(){
|
|||||||
url : "/nlib/member/phoneCertNumChk.ajax",
|
url : "/nlib/member/phoneCertNumChk.ajax",
|
||||||
type : "POST",
|
type : "POST",
|
||||||
data : {"phoneCertNum" : $("#phoneCertNum").val(),
|
data : {"phoneCertNum" : $("#phoneCertNum").val(),
|
||||||
"phone" : $("#phone").val()},
|
"telNo" : $("#telNo").val()},
|
||||||
async: false,
|
async: false,
|
||||||
success : function(result){
|
success : function(result){
|
||||||
if(result=="true")
|
if(result=="true")
|
||||||
@ -111,36 +173,104 @@ function certNumCheck(){
|
|||||||
|
|
||||||
function jusoCallBack(zipNo,roadAddrPart,addrDetail){
|
function jusoCallBack(zipNo,roadAddrPart,addrDetail){
|
||||||
// 팝업페이지에서 주소입력한 정보를 받아서, 현 페이지에 정보를 등록합니다.
|
// 팝업페이지에서 주소입력한 정보를 받아서, 현 페이지에 정보를 등록합니다.
|
||||||
$("#zipNo").val(zipNo);
|
$("#zipcode").val(zipNo);
|
||||||
$("#roadAddrPart").val(roadAddrPart);
|
$("#addr1").val(roadAddrPart);
|
||||||
$("#addrDetail").val(addrDetail);
|
$("#addr2").val(addrDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('keydown', function(event) {
|
document.addEventListener('keydown', function(event) {
|
||||||
if (event.keyCode === 13) {
|
if (event.keyCode === 13) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
function update(){
|
function checkBirthday() {
|
||||||
if($("#phoneCertYn").val()!="Y")
|
var birthday;
|
||||||
{
|
var yy = $("#birth_yy").val();
|
||||||
alert("휴대전화 인증이 필요합니다.");
|
var mm = $("#birth_mm option:selected").val();
|
||||||
|
var dd = $("#birth_dd").val();
|
||||||
|
var lang = "ko_KR";
|
||||||
|
|
||||||
|
var oyy = $("#birth_yy");
|
||||||
|
var omm = $("#birth_mm");
|
||||||
|
var odd = $("#birth_dd");
|
||||||
|
|
||||||
|
if (mm.length == 1) {
|
||||||
|
mm = "0" + mm;
|
||||||
|
}
|
||||||
|
if (dd.length == 1) {
|
||||||
|
dd = "0" + dd;
|
||||||
|
}
|
||||||
|
|
||||||
|
birthday = yy + mm + dd;
|
||||||
|
if (!isValidDate(birthday)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($("#zipNo").val()=="" || $("#roadAddrPart").val()=="" || $("#addrDetail").val()=="")
|
var age = calcAge(birthday);
|
||||||
{
|
if (age < 0) {
|
||||||
alert("주소를 입력해주세요.");
|
return false;
|
||||||
|
} else if (yy < 1900) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidDate(param) {
|
||||||
|
try {
|
||||||
|
param = param.replace(/-/g, '');
|
||||||
|
|
||||||
|
// 자리수가 맞지않을때
|
||||||
|
if (isNaN(param) || param.length != 8) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var year = Number(param.substring(0, 4));
|
||||||
|
var month = Number(param.substring(4, 6));
|
||||||
|
var day = Number(param.substring(6, 8));
|
||||||
|
|
||||||
|
if (month < 1 || month > 12) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var maxDaysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
|
||||||
|
var maxDay = maxDaysInMonth[month - 1];
|
||||||
|
|
||||||
|
// 윤년 체크
|
||||||
|
if (month == 2 && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)) {
|
||||||
|
maxDay = 29;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (day <= 0 || day > maxDay) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
;
|
||||||
if(confirm("수정하시겠습니까?")){
|
}
|
||||||
alert("수정되었습니다.");
|
|
||||||
return true;
|
function calcAge(birth) {
|
||||||
}else{
|
var date = new Date();
|
||||||
return false;
|
var year = date.getFullYear();
|
||||||
}
|
var month = (date.getMonth() + 1);
|
||||||
|
var day = date.getDate();
|
||||||
|
if (month < 10)
|
||||||
|
month = '0' + month;
|
||||||
|
if (day < 10)
|
||||||
|
day = '0' + day;
|
||||||
|
var monthDay = month + '' + day;
|
||||||
|
|
||||||
|
birth = birth.replace('-', '').replace('-', '');
|
||||||
|
var birthdayy = birth.substr(0, 4);
|
||||||
|
var birthdaymd = birth.substr(4, 4);
|
||||||
|
|
||||||
|
var age = monthDay < birthdaymd ? year - birthdayy - 1 : year - birthdayy;
|
||||||
|
return age;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -214,38 +344,86 @@ label.error {
|
|||||||
<b><font size="6" color="gray">정보수정</font></b>
|
<b><font size="6" color="gray">정보수정</font></b>
|
||||||
<br><br><br>
|
<br><br><br>
|
||||||
|
|
||||||
<form id="updateForm" name="updateForm" method="post" onsubmit="return update()" action="/nlib/userInfo/getMyInfo.do">
|
<form id="updateForm" name="updateForm" method="post" onsubmit="return update()" >
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td id="title">아이디</td>
|
<td id="title">아이디</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="id" name="id" maxlength="30" value=<c:out value="${result.id}"/> required readonly >
|
<input type="email" id="loginUserId" name="loginUserId" maxlength="30" required readonly value=<c:out value="${loginVO.loginUserId}"/> >
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td id="title">이름</td>
|
<td id="title">이름</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="userNm" name="userNm" maxlength="20" required value=<c:out value="${loginVO.userNm}"/>>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id="title">성별</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="name" name="name" maxlength="20" value=<c:out value="${result.name}"/> required>
|
<input type="radio" name="gender" value="M" required>남자
|
||||||
|
<input type="radio" name="gender" value="F" required>여자
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id="title">생년월일</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="birth_yy" name="birth_yy" maxlength="4" placeholder="년(4자)" required >
|
||||||
|
<select id="birth_mm" name="birth_mm" required>
|
||||||
|
<option value="">월</option>
|
||||||
|
<option value="01" >01</option>
|
||||||
|
<option value="02" >02</option>
|
||||||
|
<option value="03" >03</option>
|
||||||
|
<option value="04" >04</option>
|
||||||
|
<option value="05" >05</option>
|
||||||
|
<option value="06" >06</option>
|
||||||
|
<option value="07" >07</option>
|
||||||
|
<option value="08" >08</option>
|
||||||
|
<option value="09" >09</option>
|
||||||
|
<option value="10" >10</option>
|
||||||
|
<option value="11" >11</option>
|
||||||
|
<option value="12" >12</option>
|
||||||
|
</select>
|
||||||
|
<input type="text" id="birth_dd" name="birth_dd" size="2" maxlength="2" placeholder="일" size="4" required>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id="title">비밀번호</td>
|
||||||
|
<td>
|
||||||
|
<input type="password" id="userPwd" name="userPwd" minlength="8" maxlength="16"
|
||||||
|
oninvalid="this.setCustomValidity('8~16자 영문 대 소문자, 숫자, 특수문자를 사용하세요.')"
|
||||||
|
oninput="this.setCustomValidity('')"
|
||||||
|
pattern="^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,16}$" required>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td id="title">비밀번호 확인</td>
|
||||||
|
<td>
|
||||||
|
<input type="password" id="userPwdConfirm" name="userPwdConfirm" minlength="8" maxlength="16" required>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td id="title">주소</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="zipcode" name="zipcode" value="<c:out value="${loginVO.zipcode}"/>" readonly ><button type="button" style="text-align:left;" class="btn-warning" onclick="goPopup()">주소검색</button><br>
|
||||||
|
<input type="text" id="addr1" name="addr1" value="<c:out value="${loginVO.addr1}" escapeXml="false"/>" readonly />
|
||||||
|
<input type="text" id="addr2" name="addr2" value="<c:out value="${loginVO.addr2}"/>" readonly />
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td id="title">휴대전화</td>
|
<td id="title">휴대전화</td>
|
||||||
<td>
|
<td id="Cert">
|
||||||
<input type="text" id="phone" name="phone" required value=<c:out value="${result.phone}"/> ><button type="button" style="text-align:left;" class="btn-warning" onclick="phoneCert()">인증번호 받기</button>
|
<input type="text" id="telNo" name="telNo" required value="<c:out value="${loginVO.telNo}"/>" ><button type="button" style="text-align:left;" class="btn-warning" onclick="phoneCert()" required>인증번호 받기</button>
|
||||||
<div id="phoneCertForm" style="display:none;"><br><input type='text' id='phoneCertNum' name='phoneCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
|
<div id="phoneCertForm" style="display:none;"><br><input type='text' id='phoneCertNum' name='phoneCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td id="title">주소</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" id="zipNo" name="zipNo" readonly value=<c:out value="${result.zipNo}"/> ><button type="button" style="text-align:left;" class="btn-warning" onclick="goPopup()" >주소검색</button><br>
|
|
||||||
<input type="text" id="roadAddrPart" name="roadAddrPart" readonly value=<c:out value="${result.roadAddrPart}"/> ><input type="text" id="addrDetail" name="addrDetail" readonly value=<c:out value="${result.addrDetail}"/> >
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
<input type="hidden" id="phoneCertYn" name="phoneCertYn" value=<c:out value="N"/>>
|
<input type="hidden" id="phoneCertYn" name="phoneCertYn" value=<c:out value="Y"/>>
|
||||||
|
<input type="hidden" id="birthdate" name="birthdate" >
|
||||||
<input type="submit" value="수정"/> <input type="button" onclick="javascript:location.href='${pageContext.request.contextPath}/userInfo/getMyInfo.do';" value="취소">
|
<input type="submit" value="수정"/> <input type="button" onclick="javascript:location.href='${pageContext.request.contextPath}/userInfo/getMyInfo.do';" value="취소">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -37,6 +37,11 @@
|
|||||||
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
|
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
|
||||||
<title>Insert title here</title>
|
<title>Insert title here</title>
|
||||||
<script>
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
if("${message}"!="")
|
||||||
|
alert("${message}");
|
||||||
|
|
||||||
|
});
|
||||||
function goPutMyInfo(){
|
function goPutMyInfo(){
|
||||||
document.pwInputForm.action="/nlib/userInfo/putMyInfo.do";
|
document.pwInputForm.action="/nlib/userInfo/putMyInfo.do";
|
||||||
document.pwInputForm.submit();
|
document.pwInputForm.submit();
|
||||||
@ -46,7 +51,7 @@ function goPutMyInfo(){
|
|||||||
<body>
|
<body>
|
||||||
<h2>비밀번호를 입력해주세요</h2>
|
<h2>비밀번호를 입력해주세요</h2>
|
||||||
<form id="pwInputForm" name="pwInputForm" method="POST">
|
<form id="pwInputForm" name="pwInputForm" method="POST">
|
||||||
<input type="password" id="password" name="password"><button style="text-align:left;" class="btn-warning" onclick="goPutMyInfo();">확인</button>
|
<input type="password" id="userPwd" name="userPwd"><button style="text-align:left;" class="btn-warning" onclick="goPutMyInfo();">확인</button>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -14,7 +14,7 @@
|
|||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/collection/listItems.do';">소장자료검색</a></li>
|
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/collection/listItems.do';">소장자료검색</a></li>
|
||||||
|
|
||||||
<!-- 내정보 : 조회/수정 -->
|
<!-- 내정보 : 조회/수정 -->
|
||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/member/selectMemberInfo.do';">내정보</a></li>
|
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/userInfo/putMyInfo.do';">내정보</a></li>
|
||||||
<!-- 내정보 : 대출/예약/열람/관심자료 -->
|
<!-- 내정보 : 대출/예약/열람/관심자료 -->
|
||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/rent/listRentItems.do';">대출</a></li>
|
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/rent/listRentItems.do';">대출</a></li>
|
||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/rent/listReservations.do';">예약</a></li>
|
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/rent/listReservations.do';">예약</a></li>
|
||||||
|
|||||||
12
src/main/webapp/mail/pwd_mail_template.html
Normal file
12
src/main/webapp/mail/pwd_mail_template.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>비밀번호 초기화</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
초기화된 비밀번호는 <span style="color:orange">${userPwd}</span> 입니다.
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user