Skip to content

Commit

Permalink
fix: front end
Browse files Browse the repository at this point in the history
  • Loading branch information
ha-seungwon committed Aug 16, 2023
1 parent f68e351 commit 1fc0e61
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 11 deletions.
Binary file modified redis/data/dump.rdb
Binary file not shown.
13 changes: 10 additions & 3 deletions src/main/resources/static/css/personal-information.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@
flex-direction: column;
align-items: center;
}
.frame-icon58 {
.frame-icon58{
position: relative;
width: 24px;
height: 24px;
overflow: hidden;
flex-shrink: 0;
}
.frame-icon59{
position: relative;
width: 24px;
height: 24px;
width: 48;
height: 48px;
overflow: hidden;
flex-shrink: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/html/personal-information.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<div class="frame1241">
<div class="frame1242">
<img
class="frame-icon58"
class="frame-icon59"
alt=""
src="../files/586-frame.svg"
/>
Expand Down
20 changes: 16 additions & 4 deletions src/main/resources/static/js/personal-information.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const currentDomain = "http://localhost:8080"
var imgElement = document.querySelector('.frame-icon59');

async function fetchMyInfo() {
const responseMemberInfo = await fetch(currentDomain + "/api/member/me");
Expand All @@ -23,6 +24,17 @@ async function fetchMyInfo() {

name.innerText = responseMemberInfoValue.name
applicationType.innerText = responseMemberInfoValue.applicationTypeName


// 아이콘 추가하기 코드
console.log(responseMemberInfoValue.applicationTypeName)
if (responseMemberInfoValue.applicationTypeName === "경찰직공무원(남)" || responseMemberInfoValue.applicationTypeName === "경찰직공무원(여)") {
imgElement.src = "../files/type_icon4.png"; // 경찰직 이미지 경로로 변경
} else if (responseMemberInfoValue.applicationTypeName === "소방직공무원(남)" || responseMemberInfoValue.applicationTypeName === "소방직공무원(여)") {
imgElement.src = "../files/type_icon2.jpeg"; // 소방직 이미지 경로로 변경
} else if (responseMemberInfoValue.applicationTypeName === "교정직공무원(남)" || responseMemberInfoValue.applicationTypeName === "교정직공무원(여)") {
imgElement.src = "../files/type_icon3.png";// 교정직 이미지 경로로 변경
}
currentScore.innerText = "현재 점수 : " + responseScoreInfoValue.score + "점"
maxScore.innerText = "최고 점수 : " + responseScoreInfoValue.maxScore + "점"
}
Expand Down Expand Up @@ -122,14 +134,14 @@ async function showBarChart() {
datasets: [{
label: '나',
data: myScore,
backgroundColor: 'rgba(0, 0, 0, 0.2)',
borderColor: 'rgba(0, 0, 0, 1)',
backgroundColor: "rgba(66, 135, 245, 0.5)",
borderColor: "rgba(66, 135, 245, 1)",
borderWidth: 1
},{
label: '상위 30%',
data: top30Score,
backgroundColor: 'rgba(192, 192, 192, 0.2)',
borderColor: 'rgba(192, 192, 192, 1)',
backgroundColor: "rgba(66, 135, 245, 0.2)",
borderColor: "rgba(66, 135, 245, 1)",
borderWidth: 1
}]
},
Expand Down
15 changes: 12 additions & 3 deletions src/main/resources/static/js/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ function saveData() {
.then(response => response.json())
.then(result => {
if (result.prediction === 1) {
sAlert("데이터가 저장되었습니다.\n결과: 합격");
reload()
noError_sAlert("데이터가 저장되었습니다.\n결과: 합격");
location.reload();
} else {
sAlert("데이터가 저장되었습니다.\n결과: 불합격");
noError_sAlert("데이터가 저장되었습니다.\n결과: 불합격");
location.reload();
}
})
.catch(error => {
Expand Down Expand Up @@ -298,3 +299,11 @@ function sAlert(txt, title = 'ERROR',) {
confirmButtonText: '닫기'
});
}
// sAlert('custom alert example!');
function noError_sAlert(txt, title = 'Success',) {
Swal.fire({
title: title,
text: txt,
confirmButtonText: '닫기'
});
}
10 changes: 10 additions & 0 deletions src/main/resources/static/js/setting-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (passwordMachResult) {
if (!(passwordInput.value === passwordInput2.value)) {
passwordResult2.textContent = "비밀번호가 일치하지 않습니다.";
passwordResult2.style.color="red";
passwordMachResult = 0;
}
}
Expand Down Expand Up @@ -105,6 +106,13 @@ document.addEventListener("DOMContentLoaded", function () {
// 재설정 로직

passwordResult.textContent = errorMessage || "비밀번호가 유효합니다.";

if (passwordResult.textContent ==="비밀번호가 유효합니다."){
passwordResult.style.color='black';
}
else{
passwordResult.style.color='red';
}
}

function checkPasswordMatch() {
Expand All @@ -113,10 +121,12 @@ document.addEventListener("DOMContentLoaded", function () {

if (password1 === password2) {
passwordResult2.textContent = "비밀번호가 일치합니다.";
passwordResult2.style.color='black';
passwordMachResult = 1
} else {
passwordResult2.textContent = "비밀번호가 일치하지 않습니다.";
passwordMachResult = 0
passwordResult2.style.color='red';
}
}

Expand Down

0 comments on commit 1fc0e61

Please sign in to comment.