Browse Source

생활치료센터 비밀번호 초기화 추가

junekeunsong 4 năm trước cách đây
mục cha
commit
3365aeed76

+ 1 - 1
src/main/java/com/lemon/lifecenter/common/LifeCenterConfigVO.java

@@ -30,6 +30,6 @@ public class LifeCenterConfigVO {
     @Value( "${config.staff.resetPw}" )
     public String staffResetPw;
     
-    @Value( "config.center.resetPw" )
+    @Value( "${config.center.resetPw}" )
     public String centerResetPw;
 }

+ 1 - 0
src/main/java/com/lemon/lifecenter/controller/StaffController.java

@@ -275,6 +275,7 @@ public class StaffController extends LifeCenterController {
         if (type.equals("staff")) {
             pw = LifeCenterFunction.aesEncrypt(config.aesKey, config.IV, config.staffResetPw);
         } else {
+            logger.error("config.centerResetPw -- > " + config.centerResetPw);
             pw = LifeCenterFunction.aesEncrypt(config.aesKey, config.IV, config.centerResetPw);
         }
         dto.setPassword(pw);

+ 23 - 0
src/main/webapp/WEB-INF/jsp/center/info.jsp

@@ -5,6 +5,24 @@
 <%@ page language="java" contentType="text/html; charset=UTF-8"
     pageEncoding="UTF-8"%>
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<script type="text/javascript">
+function reset() {
+    var resetCheck = confirm("비밀번호를 초기화 하시겠습니까?");
+    if (resetCheck == true) {
+        getAjax("/staff/passwordReset", $("#hiddenForm").serialize(), function ( result ) {
+            console.log( result );
+            if (result === true) {
+                alert('비밀번호가 초기화 되었습니다.');
+            }
+        }, function(){
+            alert('비밀번호가 초기화에 실패하였습니다.');
+        }, function(){
+            
+        });
+    }
+}
+
+</script>
 </head>
 <body>
     <div class="wrapper">
@@ -14,6 +32,10 @@
             <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
 
             <main class="content">
+                <form id="hiddenForm">
+                    <input type="hidden" id="staffId" name="staffId" value="<c:out value="${centerInfo.staffId}" />">
+                    <input type="hidden" id="type" name="type" value="center">
+                </form>
                 <div class="container-fluid p-0">
                     <!-- 환자관리 : 신규환자 등록 START -->
                     <div class="row">
@@ -102,6 +124,7 @@
                                     <div class="row mt-3">
                                         <div class="col-12">
                                             <div class="text-right">
+                                                <button class="btn btn-warning w150" onclick="reset();">비밀번호 초기화</button>
                                                 <button type="button" class="btn btn-primary w100" onclick="location.href='./list';">확인</button>
                                             </div>
                                         </div>

+ 4 - 4
src/main/webapp/WEB-INF/jsp/staff/info.jsp

@@ -31,10 +31,10 @@ function reset() {
             <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
 
             <main class="content">
-            <form id="hiddenForm">
-                <input type="hidden" id="staffId" name="staffId" value="<c:out value="${info.id}" />">
-                <input type="hidden" id="type" name="type" value="staff">
-            </form>
+                <form id="hiddenForm">
+                    <input type="hidden" id="staffId" name="staffId" value="<c:out value="${info.id}" />">
+                    <input type="hidden" id="type" name="type" value="staff">
+                </form>
                 <div class="container-fluid p-0">
                     <!-- 환자관리 : 신규환자 등록 START -->
                     <div class="row">