마이페이지 비밀번호 수정기능 추가

This commit is contained in:
Kana
2024-01-24 17:07:19 +09:00
parent 02f31c224e
commit da7a0cf9d5
5 changed files with 23 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ public interface AccountMapper {
int insertToAuthority(AuthorityDto dto);
int update(AccountDto dto);
int updateIncludePassword(AccountDto dto);
AccountDto selectById(AccountDto dto);

View File

@@ -24,6 +24,9 @@ public class AccountService {
public int update(AccountDto dto){
return mapper.update(dto);
}
public int updateIncludePassword(AccountDto dto) {
return mapper.updateIncludePassword(dto);
}
public AccountDto selectById(AccountDto dto){
return mapper.selectById(dto);

View File

@@ -83,7 +83,7 @@ public class MypageController {
@ResponseBody
@PutMapping("/mypage/updateUserInfo")
public boolean updateUserInfo(AccountDto dto) {
int i = accountService.update(dto);
int i = accountService.updateIncludePassword(dto);
System.out.println(i);
if (i == 1) {
return true;

View File

@@ -137,6 +137,22 @@
activation = #{activation}
WHERE id = #{id}
</update>
<update id="updateIncludePassword" parameterType="accountDto">
update account SET
name = #{name},
password = #{password},
employee_number = #{employeeNumber},
email = #{email},
personal_authority_id = #{personalAuthorityId},
gender = #{gender},
birth = #{birth},
telephone = #{telephone},
address = #{address},
department_id = #{departmentId},
position_id = #{positionId},
activation = #{activation}
WHERE id = #{id}
</update>
<update id="delete" parameterType="accountDto">
update account SET activation = false WHERE id = #{id}
</update>

View File

@@ -145,6 +145,7 @@
$("#submitBtn").on("click",function(){
//
var name = $("#name").val();
var password = $("#password").val();
var employeeNumber = $("#employeeNumber").val();
var email = $("#email").val();
var personalAuthorityId = $("#personalAuthorityId").val();
@@ -158,6 +159,7 @@
var activation = true;
const data = { name : name,
password : password,
employeeNumber : employeeNumber,
email : email,
personalAuthorityId : personalAuthorityId,