사용자 정보 업데이트 로직 수정.
에디터 사진 업로드시 크기조정 추가. 배포 환경 properties 수정. jdbc jar 추가. 모달 디자인 수정중.
parent
ecd4237209
commit
e0ebe503fb
|
|
@ -33,7 +33,9 @@ dependencies {
|
|||
implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16'
|
||||
runtimeOnly 'org.postgresql:postgresql:42.3.6'
|
||||
implementation 'com.oracle.database.jdbc:ojdbc8:21.7.0.0'
|
||||
|
||||
//tibero
|
||||
implementation files('libs/tibero6-jdbc.jar')
|
||||
|
||||
// json
|
||||
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
|
||||
|
||||
|
|
@ -44,4 +46,5 @@ dependencies {
|
|||
|
||||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:2.7.2'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.24'
|
||||
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,12 +1,6 @@
|
|||
package com.dbnt.faisp.config;
|
||||
|
||||
import com.dbnt.faisp.main.menuMgt.service.MenuMgtService;
|
||||
import org.springframework.core.env.Environment;
|
||||
import com.dbnt.faisp.main.organMgt.service.OrganConfigService;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
||||
|
||||
import com.dbnt.faisp.main.userInfo.service.UserInfoService;
|
||||
import com.dbnt.faisp.util.ParamMap;
|
||||
import com.dbnt.faisp.util.Utils;
|
||||
|
||||
|
|
@ -14,7 +8,6 @@ import lombok.RequiredArgsConstructor;
|
|||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
|
||||
|
|
@ -29,7 +22,12 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
|
@ -38,89 +36,102 @@ import javax.servlet.http.HttpSession;
|
|||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class EditorController {
|
||||
|
||||
|
||||
@Value("${site.domain}")
|
||||
protected String siteDomain;
|
||||
|
||||
|
||||
@Value("${file.dir}")
|
||||
protected String fileDir;
|
||||
|
||||
|
||||
@Value("${file.dir.editor}")
|
||||
protected String editorPath;
|
||||
|
||||
|
||||
@Value("${editor.img.view}")
|
||||
protected String imgView;
|
||||
|
||||
|
||||
@PostMapping("/Crosseditor/uploadImg")
|
||||
public @ResponseBody JSONObject uploadImg(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
JSONObject data = new JSONObject();
|
||||
JSONArray req_array = new JSONArray();
|
||||
|
||||
try {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request;
|
||||
MultipartFile mFile = multipartRequest.getFile("imageFile");
|
||||
if(!"".equals(mFile.getOriginalFilename())){
|
||||
|
||||
String attach_file_Name = mFile.getOriginalFilename();
|
||||
String attach_save_Name = Utils.generationSaveName();
|
||||
String imageKind = request.getParameter("imageKind");
|
||||
String editorFrame = request.getParameter("editorFrame");
|
||||
|
||||
//파일 타입
|
||||
String extNm = "." + attach_file_Name.substring( attach_file_Name.lastIndexOf( "." ) + 1, attach_file_Name.length());
|
||||
if(".jpg,.png,.jpeg".indexOf(extNm.toLowerCase()) > -1) {
|
||||
|
||||
File dir = new File(fileDir+File.separator+editorPath);
|
||||
if (!dir.exists()) {
|
||||
try{
|
||||
|
||||
// 생성
|
||||
boolean result2 = dir.mkdir();
|
||||
if (result2) {
|
||||
System.out.println("Directory is created.");
|
||||
} else {
|
||||
System.out.println("Failed to create directory.");
|
||||
}
|
||||
} catch(Exception e){
|
||||
System.out.println("Exception occurred.");
|
||||
e.getStackTrace();
|
||||
}
|
||||
} else {
|
||||
System.out.println("Directory already exists");
|
||||
}
|
||||
|
||||
File file = new File(fileDir+File.separator+editorPath, attach_save_Name + extNm);
|
||||
FileCopyUtils.copy(mFile.getBytes(), file);
|
||||
|
||||
String webPath = siteDomain+ imgView + attach_save_Name + extNm;
|
||||
public @ResponseBody JSONObject uploadImg(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
|
||||
|
||||
jsonObject.put("result","success");
|
||||
data.put("imageURL",webPath);
|
||||
data.put("imageKind", imageKind);
|
||||
data.put("editorFrame", editorFrame);
|
||||
req_array.add(data);
|
||||
jsonObject.put("addmsg", req_array);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
JSONObject data = new JSONObject();
|
||||
JSONArray req_array = new JSONArray();
|
||||
|
||||
} else {
|
||||
ParamMap error = new ParamMap();
|
||||
error.set("message", "Check File Extentions.");
|
||||
}
|
||||
} else {
|
||||
ParamMap error = new ParamMap();
|
||||
error.set("message", "Check File Extentions.");
|
||||
try {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request;
|
||||
MultipartFile mFile = multipartRequest.getFile("imageFile");
|
||||
if(!"".equals(mFile.getOriginalFilename())){
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ParamMap error = new ParamMap();
|
||||
error.set("message", "Check File Extentions.");
|
||||
}
|
||||
String attach_file_Name = mFile.getOriginalFilename();
|
||||
String attach_save_Name = Utils.generationSaveName();
|
||||
String imageKind = request.getParameter("imageKind");
|
||||
String editorFrame = request.getParameter("editorFrame");
|
||||
|
||||
return jsonObject;
|
||||
//파일 타입
|
||||
String extNm = attach_file_Name.substring( attach_file_Name.lastIndexOf( "." ) + 1);
|
||||
if("jpg,png,jpeg".contains(extNm.toLowerCase())) {
|
||||
|
||||
File dir = new File(fileDir+File.separator+editorPath);
|
||||
if (!dir.exists()) {
|
||||
try{
|
||||
|
||||
// 생성
|
||||
boolean result2 = dir.mkdir();
|
||||
if (result2) {
|
||||
System.out.println("Directory is created.");
|
||||
} else {
|
||||
System.out.println("Failed to create directory.");
|
||||
}
|
||||
} catch(Exception e){
|
||||
System.out.println("Exception occurred.");
|
||||
e.getStackTrace();
|
||||
}
|
||||
} else {
|
||||
System.out.println("Directory already exists");
|
||||
}
|
||||
|
||||
File file = new File(fileDir+File.separator+editorPath, attach_save_Name +"."+ extNm);
|
||||
FileCopyUtils.copy(mFile.getBytes(), file);
|
||||
InputStream is = new FileInputStream(file);
|
||||
BufferedImage input = ImageIO.read(is);
|
||||
if(input.getWidth()>720){
|
||||
int width = 720;
|
||||
int height = (int) (input.getHeight()*(720d/input.getWidth()));
|
||||
|
||||
Image resizeImage = input.getScaledInstance(width, height, Image.SCALE_SMOOTH);
|
||||
BufferedImage output = new BufferedImage(width, height, input.getType());
|
||||
Graphics graphics = output.createGraphics();
|
||||
graphics.drawImage(resizeImage, 0, 0, null);
|
||||
graphics.dispose();
|
||||
ImageIO.write(output, extNm, file);
|
||||
}
|
||||
|
||||
String webPath = siteDomain+ imgView + attach_save_Name +"."+ extNm;
|
||||
|
||||
jsonObject.put("result","success");
|
||||
data.put("imageURL",webPath);
|
||||
data.put("imageKind", imageKind);
|
||||
data.put("editorFrame", editorFrame);
|
||||
req_array.add(data);
|
||||
jsonObject.put("addmsg", req_array);
|
||||
|
||||
} else {
|
||||
ParamMap error = new ParamMap();
|
||||
error.set("message", "Check File Extentions.");
|
||||
}
|
||||
} else {
|
||||
ParamMap error = new ParamMap();
|
||||
error.set("message", "Check File Extentions.");
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ParamMap error = new ParamMap();
|
||||
error.set("message", "Check File Extentions.");
|
||||
}
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,14 @@ import com.dbnt.faisp.util.ParamMap;
|
|||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
|
@ -37,161 +39,90 @@ public class UserInfoService implements UserDetailsService {
|
|||
userInfo.setPassword(convertPassword(userInfo.getPassword()));
|
||||
userInfo.setWrtDt(LocalDateTime.now());
|
||||
UserInfo result = userInfoRepository.save(userInfo);
|
||||
UserInfoHistory dbHis = userInfoHistoryRepository.findByUserSeq(result.getUserSeq());
|
||||
if(dbHis == null) {
|
||||
UserInfoHistory hisTmp = new UserInfoHistory();
|
||||
hisTmp.setUserSeq(result.getUserSeq());
|
||||
hisTmp.setVersionNo(1);
|
||||
hisTmp.setDicCode(result.getDicCode());
|
||||
hisTmp.setUserId(result.getUserId());
|
||||
hisTmp.setUserNm(result.getUserNm());
|
||||
hisTmp.setBirthDate(result.getBirthDate());
|
||||
hisTmp.setSex(result.getSex());
|
||||
hisTmp.setEmail(result.getEmail());
|
||||
hisTmp.setPhoneNo(result.getPhoneNo());
|
||||
hisTmp.setAreaCd(result.getAreaCd());
|
||||
hisTmp.setOgCd(result.getOgCd());
|
||||
hisTmp.setOfcCd(result.getOfcCd());
|
||||
hisTmp.setTitleCd(result.getTitleCd());
|
||||
hisTmp.setGroupCd(result.getGroupCd());
|
||||
hisTmp.setSeriesCd(result.getSeriesCd());
|
||||
hisTmp.setOfcHeadYn(result.getOfcHeadYn());
|
||||
hisTmp.setHiringCd(result.getHiringCd());
|
||||
hisTmp.setEmployCd(result.getEmployCd());
|
||||
hisTmp.setOutturnCd(result.getOutturnCd());
|
||||
hisTmp.setWorkCd(result.getWorkCd());
|
||||
hisTmp.setJobInCd(result.getJobInCd());
|
||||
hisTmp.setLanguageCd(result.getLanguageCd());
|
||||
hisTmp.setPoliceInDate(result.getPoliceInDate());
|
||||
hisTmp.setOrganInDate(result.getOrganInDate());
|
||||
hisTmp.setOfcInDate(result.getOfcInDate());
|
||||
hisTmp.setTitleInDate(result.getTitleInDate());
|
||||
hisTmp.setUserStatus(result.getUserStatus());
|
||||
hisTmp.setWrtOrgan(result.getOgCd());
|
||||
hisTmp.setWrtPart(result.getOfcCd());
|
||||
hisTmp.setWrtTitle(result.getTitleCd());
|
||||
hisTmp.setWrtUserSeq(result.getUserSeq());
|
||||
hisTmp.setWrtNm(result.getUserNm());
|
||||
hisTmp.setWrtDt(result.getWrtDt());
|
||||
userInfoHistoryRepository.save(hisTmp);
|
||||
}
|
||||
saveUserInfoHistory(result, result);
|
||||
return result.getUserId();
|
||||
}
|
||||
@Transactional
|
||||
public void updateUserInfo(UserInfo loginUser,UserInfo userInfo){
|
||||
UserInfo savedInfo = userInfoRepository.findById(userInfo.getUserSeq()).orElse(null);
|
||||
if(savedInfo!=null){
|
||||
if(userInfo.getDicCode()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getDicCode())){
|
||||
savedInfo.setDicCode(userInfo.getDicCode());
|
||||
}
|
||||
if(userInfo.getUserNm()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getUserNm())){
|
||||
savedInfo.setUserNm(userInfo.getUserNm());
|
||||
}
|
||||
if(userInfo.getPassword()!=null && userInfo.getPassword()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getPassword())){
|
||||
savedInfo.setPassword(convertPassword(userInfo.getPassword()));
|
||||
}
|
||||
if(userInfo.getPhoneNo()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getPhoneNo())){
|
||||
savedInfo.setPhoneNo(userInfo.getPhoneNo());
|
||||
}
|
||||
if(userInfo.getEmail()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getEmail())){
|
||||
savedInfo.setEmail(userInfo.getEmail());
|
||||
}
|
||||
if(userInfo.getSex()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getSex())){
|
||||
savedInfo.setSex(userInfo.getSex());
|
||||
}
|
||||
if(userInfo.getOgCd()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getOgCd())){
|
||||
savedInfo.setOgCd(userInfo.getOgCd());
|
||||
}
|
||||
if(userInfo.getOfcCd()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getOfcCd())){
|
||||
savedInfo.setOfcCd(userInfo.getOfcCd());
|
||||
}
|
||||
if(userInfo.getTitleCd()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getTitleCd())){
|
||||
savedInfo.setTitleCd(userInfo.getTitleCd());
|
||||
}
|
||||
if(userInfo.getOutturnCd()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getOutturnCd())){
|
||||
savedInfo.setOutturnCd(userInfo.getOutturnCd());
|
||||
}
|
||||
if(userInfo.getSeriesCd()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getSeriesCd())){
|
||||
savedInfo.setSeriesCd(userInfo.getSeriesCd());
|
||||
}
|
||||
if(userInfo.getBirthDate()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getBirthDate())){
|
||||
savedInfo.setBirthDate(userInfo.getBirthDate());
|
||||
}
|
||||
if(userInfo.getPoliceInDate()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getPoliceInDate())){
|
||||
savedInfo.setPoliceInDate(userInfo.getPoliceInDate());
|
||||
}
|
||||
if(userInfo.getOrganInDate()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getOrganInDate())){
|
||||
savedInfo.setOrganInDate(userInfo.getOrganInDate());
|
||||
}
|
||||
if(userInfo.getOfcInDate()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getOfcInDate())){
|
||||
savedInfo.setOfcInDate(userInfo.getOfcInDate());
|
||||
}
|
||||
if(userInfo.getTitleInDate()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getTitleInDate())){
|
||||
savedInfo.setTitleInDate(userInfo.getTitleInDate());
|
||||
}
|
||||
if(userInfo.getLanguageCd()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getLanguageCd())){
|
||||
savedInfo.setLanguageCd(userInfo.getLanguageCd());
|
||||
}
|
||||
if(userInfo.getOfcHeadYn()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getOfcHeadYn())){
|
||||
savedInfo.setOfcHeadYn(userInfo.getOfcHeadYn());
|
||||
}
|
||||
if(userInfo.getUserRole()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getUserRole())){
|
||||
savedInfo.setUserRole(userInfo.getUserRole());
|
||||
}
|
||||
if(userInfo.getUserStatus()!=null){
|
||||
if(!ObjectUtils.isEmpty(userInfo.getUserStatus())){
|
||||
savedInfo.setUserStatus(userInfo.getUserStatus());
|
||||
}
|
||||
userInfoRepository.save(savedInfo);
|
||||
UserInfoHistory dbHis = userInfoHistoryRepository.findTopByUserSeqOrderByVersionNoDesc(savedInfo.getUserSeq());
|
||||
if(dbHis != null) {
|
||||
UserInfoHistory hisTmp = new UserInfoHistory();
|
||||
hisTmp.setUserSeq(savedInfo.getUserSeq());
|
||||
hisTmp.setVersionNo(dbHis.getVersionNo()+1);
|
||||
hisTmp.setDicCode(savedInfo.getDicCode());
|
||||
hisTmp.setUserId(savedInfo.getUserId());
|
||||
hisTmp.setUserNm(savedInfo.getUserNm());
|
||||
hisTmp.setBirthDate(savedInfo.getBirthDate());
|
||||
hisTmp.setSex(savedInfo.getSex());
|
||||
hisTmp.setEmail(savedInfo.getEmail());
|
||||
hisTmp.setPhoneNo(savedInfo.getPhoneNo());
|
||||
hisTmp.setAreaCd(savedInfo.getAreaCd());
|
||||
hisTmp.setOgCd(savedInfo.getOgCd());
|
||||
hisTmp.setOfcCd(savedInfo.getOfcCd());
|
||||
hisTmp.setTitleCd(savedInfo.getTitleCd());
|
||||
hisTmp.setGroupCd(savedInfo.getGroupCd());
|
||||
hisTmp.setSeriesCd(savedInfo.getSeriesCd());
|
||||
hisTmp.setOfcHeadYn(savedInfo.getOfcHeadYn());
|
||||
hisTmp.setHiringCd(savedInfo.getHiringCd());
|
||||
hisTmp.setEmployCd(savedInfo.getEmployCd());
|
||||
hisTmp.setOutturnCd(savedInfo.getOutturnCd());
|
||||
hisTmp.setWorkCd(savedInfo.getWorkCd());
|
||||
hisTmp.setJobInCd(savedInfo.getJobInCd());
|
||||
hisTmp.setLanguageCd(savedInfo.getLanguageCd());
|
||||
hisTmp.setPoliceInDate(savedInfo.getPoliceInDate());
|
||||
hisTmp.setOrganInDate(savedInfo.getOrganInDate());
|
||||
hisTmp.setOfcInDate(savedInfo.getOfcInDate());
|
||||
hisTmp.setTitleInDate(savedInfo.getTitleInDate());
|
||||
hisTmp.setUserStatus(savedInfo.getUserStatus());
|
||||
hisTmp.setWrtOrgan(loginUser.getOgCd());
|
||||
hisTmp.setWrtPart(loginUser.getOfcCd());
|
||||
hisTmp.setWrtTitle(loginUser.getTitleCd());
|
||||
hisTmp.setWrtUserSeq(loginUser.getUserSeq());
|
||||
hisTmp.setWrtNm(loginUser.getUserNm());
|
||||
hisTmp.setWrtDt(LocalDateTime.now());
|
||||
userInfoHistoryRepository.save(hisTmp);
|
||||
}
|
||||
saveUserInfoHistory(savedInfo, loginUser);
|
||||
}
|
||||
}
|
||||
|
||||
public String updatePassword(UserInfo loginUser, UserInfo modifyInfo){
|
||||
Pbkdf2PasswordEncoder passwordEncoder = new Pbkdf2PasswordEncoder();
|
||||
if(passwordEncoder.matches(modifyInfo.getPassword(), loginUser.getPassword())){
|
||||
loginUser.setPassword(convertPassword(modifyInfo.getModifyPassword()));
|
||||
userInfoRepository.save(loginUser);
|
||||
return "OK";
|
||||
}else{
|
||||
return "passwordNotMatch";
|
||||
}
|
||||
private void saveUserInfoHistory(UserInfo savedInfo, UserInfo loginUser){
|
||||
UserInfoHistory dbHis = userInfoHistoryRepository.findTopByUserSeqOrderByVersionNoDesc(savedInfo.getUserSeq());
|
||||
UserInfoHistory hisTmp = new UserInfoHistory();
|
||||
BeanUtils.copyProperties(savedInfo, hisTmp);
|
||||
hisTmp.setVersionNo(dbHis==null?1:dbHis.getVersionNo()+1);
|
||||
hisTmp.setWrtOrgan(loginUser.getOgCd());
|
||||
hisTmp.setWrtPart(loginUser.getOfcCd());
|
||||
hisTmp.setWrtTitle(loginUser.getTitleCd());
|
||||
hisTmp.setWrtUserSeq(loginUser.getUserSeq());
|
||||
hisTmp.setWrtNm(loginUser.getUserNm());
|
||||
hisTmp.setWrtDt(LocalDateTime.now());
|
||||
userInfoHistoryRepository.save(hisTmp);
|
||||
}
|
||||
|
||||
private String convertPassword(String password){
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ spring.sql.init.encoding=utf-8
|
|||
spring.datasource.hikari.maximum-pool-size=4
|
||||
#postgresql
|
||||
spring.datasource-main.driverClassName=org.postgresql.Driver
|
||||
spring.datasource-main.url=jdbc:postgresql://118.219.150.34:50503/faisp
|
||||
spring.datasource-main.username=dbnt0031
|
||||
spring.datasource-main.password=dbnt0928!
|
||||
#oracle
|
||||
spring.datasource-kwms.driverClassName=oracle.jdbc.driver.OracleDriver
|
||||
spring.datasource-kwms.jdbcUrl=jdbc:oracle:thin:@118.219.150.34:51521:kwms
|
||||
spring.datasource-kwms.username=kwms
|
||||
spring.datasource-kwms.password=dbnt0928
|
||||
spring.datasource-main.url=jdbc:postgresql://10.187.142.13:5432/experdb
|
||||
spring.datasource-main.username=experdb
|
||||
spring.datasource-main.password=Ground453!@
|
||||
#tibero
|
||||
spring.datasource-kwms.driverClassName=com.tmax.tibero.jdbc.TbDriver
|
||||
spring.datasource-kwms.jdbcUrl=jdbc:tibero:thin:@10.29.2.199:8629:tibero
|
||||
spring.datasource-kwms.username=smartonek_hrms
|
||||
spring.datasource-kwms.password=SmartOneK5715
|
||||
|
||||
#jpa
|
||||
spring.jpa.show-sql=false
|
||||
|
|
|
|||
|
|
@ -20,24 +20,32 @@ $(function (){
|
|||
})
|
||||
$(document).on('click', '#updateBtn', function (){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
contentFade("in");
|
||||
const formData = new FormData($("#userInfoUpdate")[0]);
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/myInfo/updateSelf",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function() {
|
||||
alert("저장되었습니다.");
|
||||
contentFade("out");
|
||||
location.reload();
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("저장에 실패하였습니다.");
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
let flag = true
|
||||
const passwordChange = $("#passwordChange");
|
||||
if(passwordChange.val()){
|
||||
flag = passwordCheck(passwordChange)
|
||||
formData.append("password", passwordChange.val());
|
||||
}
|
||||
if(flag){
|
||||
contentFade("in");
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/myInfo/updateSelf",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function() {
|
||||
alert("저장되었습니다.");
|
||||
contentFade("out");
|
||||
location.reload();
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("저장에 실패하였습니다.");
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
$(document).on('click', '#syncBtn', function (){
|
||||
|
|
@ -167,30 +175,20 @@ function orderNumSort(){
|
|||
})
|
||||
}
|
||||
|
||||
function passwordCheck(){
|
||||
function passwordCheck(passwordChange){
|
||||
let returnFlag = true;
|
||||
const password = $("#password");
|
||||
const modifyPassword =$("#modifyPassword");
|
||||
const passwordConfirm = $("#passwordConfirm");
|
||||
if(!password.val()){
|
||||
alert("비밀번호를 입력해주세요.");
|
||||
returnFlag = false;
|
||||
}
|
||||
if(!modifyPassword.val()){
|
||||
alert("새 비밀번호를 입력해주세요.");
|
||||
returnFlag = false;
|
||||
}
|
||||
if(!passwordConfirm.val()){
|
||||
alert("비밀번호 확인을 입력해주세요.");
|
||||
returnFlag = false;
|
||||
}
|
||||
if(returnFlag){
|
||||
const passwordReg = /^(?=.*[a-zA-z])(?=.*[0-9])(?=.*[$`~!@$!%*#^?&\\(\\)\-_=+]).{8,16}$/;
|
||||
if(!passwordReg.test(modifyPassword.val())){
|
||||
if(!passwordReg.test(passwordChange.val())){
|
||||
alert("비밀번호 조건이 맞지 않습니다.")
|
||||
returnFlag = false;
|
||||
}else{
|
||||
if(modifyPassword.val() !== passwordConfirm.val()){
|
||||
if(passwordChange.val() !== passwordConfirm.val()){
|
||||
alert("비밀번호가 같지 않습니다.");
|
||||
returnFlag = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="viewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="viewModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-dialog modal-xxl modal-dialog-scrollable">
|
||||
<div class="modal-content" id="viewContent">
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
<div class="row mb-1">
|
||||
<label for="modalPassword" class="col-sm-2 col-form-label col-form-label-sm text-center">비밀번호</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="password" class="form-control form-control-sm" id="modalPassword" name="password" autocomplete="off">
|
||||
<input type="password" class="form-control form-control-sm" id="passwordChange" name="passwordChange" autocomplete="new-password">
|
||||
<label for="userId" style="font-size: 12px">8~16자 사이의 알파벳, 숫자, 특수문자 조합</label>
|
||||
</div>
|
||||
<label for="passwordConfirm" class="col-sm-2 col-form-label col-form-label-sm text-center">비밀번호 확인</label>
|
||||
|
|
|
|||
Loading…
Reference in New Issue