비밀번호 초기화및 이리저리 수정

This commit is contained in:
Suh
2024-01-25 18:36:21 +09:00
parent 4aeddf2fa1
commit 5fcf22e5e8
4 changed files with 26 additions and 28 deletions

View File

@@ -39,7 +39,6 @@ public class ResetPasswordController {
List<Map<String, Object>> dto = resetPasswordService.list(searchn, search, startRow ,perPage); List<Map<String, Object>> dto = resetPasswordService.list(searchn, search, startRow ,perPage);
m.addAttribute("rlist", dto); m.addAttribute("rlist", dto);
m.addAttribute("start", startRow + 1); m.addAttribute("start", startRow + 1);
int pageNum = 5;//보여질 페이지 번호 수 int pageNum = 5;//보여질 페이지 번호 수
@@ -74,6 +73,7 @@ public class ResetPasswordController {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ResponseBody @ResponseBody
public int delete(ResetPasswordDto dto){ public int delete(ResetPasswordDto dto){
System.out.println(dto);
int i = resetPasswordService.delete(dto); int i = resetPasswordService.delete(dto);
return i; return i;
@@ -82,6 +82,7 @@ public class ResetPasswordController {
@PutMapping("/update") @PutMapping("/update")
@ResponseBody @ResponseBody
public boolean update(ResetPasswordDto dto) throws NoSuchAlgorithmException { public boolean update(ResetPasswordDto dto) throws NoSuchAlgorithmException {
System.out.println(dto);
AccountDto accountDto = new AccountDto(); AccountDto accountDto = new AccountDto();
accountDto.setId(dto.getAccountId()); accountDto.setId(dto.getAccountId());
accountDto = accountService.selectById(accountDto); accountDto = accountService.selectById(accountDto);

View File

@@ -24,7 +24,6 @@ public class ResetPasswordService {
public List<Map<String, Object>> list(int searchn, String search, int start, int perPage){ public List<Map<String, Object>> list(int searchn, String search, int start, int perPage){
System.out.println(searchn+search);
Map<String, Object> m = new HashMap<String, Object>(); Map<String, Object> m = new HashMap<String, Object>();
m.put("searchn",searchn); m.put("searchn",searchn);

View File

@@ -154,7 +154,7 @@
LEFT JOIN product as pro on proin.product_id = pro.id LEFT JOIN product as pro on proin.product_id = pro.id
LEFT JOIN warehouse as w on proin.warehouse_id = w.id LEFT JOIN warehouse as w on proin.warehouse_id = w.id
LEFT JOIN account as a on proin.manager_id = a.id LEFT JOIN account as a on proin.manager_id = a.id
WHERE proin.in_date = #{today} and proin.activation = 1 WHERE proin.in_date LIKE CONCAT(#{today},'%') and proin.activation = 1
ORDER BY proin.in_date desc LIMIT 5 ORDER BY proin.in_date desc LIMIT 5
</select> </select>

View File

@@ -57,13 +57,10 @@
<td class="col-1">${dto.email }</td> <td class="col-1">${dto.email }</td>
<td class="col-1">${dto.note }</td> <td class="col-1">${dto.note }</td>
<td class="col-1"> <td class="col-1">
<button type="button" class="btn btn-primary" data-resetpassword="${dto.id}" <button type="button" class="resetpassword btn btn-primary" data-accountid='${dto.account_id}' data-resetpassword="${dto.id}">확인
id="resetpassword">확인
</button> </button>
<button type="button" class="btn btn-warning" data-resetpasswordDelete="${dto.id}" <button type="button" class="resetpasswordDelete btn btn-warning" data-id="${dto.id}">취소
id="resetpasswordDelete">취소
</button> </button>
<input type="hidden" id="id" value="${dto.id}"/>
</td> </td>
</tr> </tr>
</c:forEach> </c:forEach>
@@ -112,13 +109,15 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$("#resetpassword").on("click", function(){ $(".resetpassword").on("click", function(event){
var id = $("#id").val(); var id = $(event.currentTarget).data("resetpassword");
const accountId = $(event.currentTarget).data("accountid");
$.ajax({ $.ajax({
url: "/resetpassword/update", url: "/resetpassword/update",
type: "put", type: "put",
data: { data: {
"id": id, "id": id,
"accountId" : accountId
}, },
datatype:"json" datatype:"json"
}).done(function (data) { }).done(function (data) {
@@ -146,8 +145,8 @@
}); });
}); });
$("#resetpasswordDelete").on("click", function(){ $(".resetpasswordDelete").on("click", function(event){
var id = $("#id").val(); var id = $(event.currentTarget).data("id");
$.ajax({ $.ajax({
url: "/resetpassword/delete", url: "/resetpassword/delete",
type: "delete", type: "delete",
@@ -157,7 +156,6 @@
datatype:"json" datatype:"json"
}).done(function (data) { }).done(function (data) {
if (data == true) { if (data == true) {
alert("요청을 거절하였습니다.");
var form = document.createElement("form"); var form = document.createElement("form");
form.action = "/resetpassword/list"; form.action = "/resetpassword/list";
form.method = "get"; form.method = "get";