Compare commits
9 Commits
2a29f53479
...
21dd389deb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21dd389deb | ||
|
|
bef3b58ef4 | ||
|
|
7548257db6 | ||
|
|
93473b1822 | ||
|
|
853af1ec43 | ||
| 771d28edfe | |||
|
|
4f46641774 | ||
|
|
1be82da0a6 | ||
|
|
a7112b7bc0 |
@@ -0,0 +1,13 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Controller
|
||||
public class BookUpdateConfirmController {
|
||||
|
||||
@PostMapping("/updateconfirm")
|
||||
public String updateConfirm() {
|
||||
return "updateconfirm";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Controller
|
||||
public class BookUpdateController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public String update() {
|
||||
return "update";
|
||||
}
|
||||
|
||||
@PostMapping("/bookUpdate")
|
||||
public String bookUpdate() {
|
||||
return "book";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class PasswordChangeController {
|
||||
|
||||
@GetMapping("/passwordChange")
|
||||
public String showPasswordChange() {
|
||||
|
||||
return "passwordChange";
|
||||
}
|
||||
}
|
||||
40
src/main/java/com/example/demo/entity/Account.java
Normal file
40
src/main/java/com/example/demo/entity/Account.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/*
|
||||
* accountテーブル用のEntityクラス
|
||||
* ログイン時やセッションでの管理者判別に使う
|
||||
*/
|
||||
|
||||
@Entity
|
||||
@Table(name = "account")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class Account {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name="login_info_id")
|
||||
private int loginInfoId;
|
||||
|
||||
@Column(name="employee_id")
|
||||
private int employeeId;
|
||||
|
||||
@Column(name="password_hash")
|
||||
private String passwordHash;
|
||||
|
||||
@Column(name="admin_flag")
|
||||
private int adminFlag;
|
||||
|
||||
}
|
||||
62
src/main/resources/static/js/passwordChange.js
Normal file
62
src/main/resources/static/js/passwordChange.js
Normal file
@@ -0,0 +1,62 @@
|
||||
function togglePassword(id) {
|
||||
|
||||
const input = document.getElementById(id);
|
||||
|
||||
if (input === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.type === "password") {
|
||||
input.type = "text";
|
||||
} else {
|
||||
input.type = "password";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function clearForm() {
|
||||
|
||||
const form = document.getElementById("pwForm");
|
||||
|
||||
if (form === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.reset();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showCompletedPopup() {
|
||||
|
||||
const completedDialog = document.getElementById("completedDialog");
|
||||
|
||||
if (completedDialog === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
completedDialog.showModal();
|
||||
}
|
||||
|
||||
function goTopMenu() {
|
||||
|
||||
const topMenuUrl = document.body.dataset.topmenuUrl;
|
||||
|
||||
if (topMenuUrl) {
|
||||
window.location.href = topMenuUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = "/topmenu";
|
||||
}
|
||||
|
||||
function goLogin(){
|
||||
const loginUrl = document.body.dataset.loginUrl;
|
||||
|
||||
if (loginUrl){
|
||||
window.location.href = loginUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href="/login"
|
||||
}
|
||||
@@ -13,6 +13,13 @@
|
||||
貸出
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="update">
|
||||
<button type="submit" class="btn-login">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
|
||||
更新
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
377
src/main/resources/templates/passwordChange.html
Normal file
377
src/main/resources/templates/passwordChange.html
Normal file
@@ -0,0 +1,377 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" lang="ja">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ShareBooks|パスワード変更</title>
|
||||
</head>
|
||||
|
||||
<body th:data-topmenu-url="@{/topmenu}">
|
||||
|
||||
<!-- ヘッダー -->
|
||||
<div class="header-bar">
|
||||
|
||||
<div class="header-left">
|
||||
ShareBooks
|
||||
</div>
|
||||
|
||||
<div class="header-right">
|
||||
|
||||
<span class="bell">
|
||||
🔔
|
||||
<span class="badge">3</span>
|
||||
</span>
|
||||
|
||||
<span class="user">
|
||||
テストユーザー(一般)
|
||||
</span>
|
||||
|
||||
<button type="button" class="logout">
|
||||
ログアウト
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layout">
|
||||
|
||||
<!-- サイドバー -->
|
||||
<div class="sidebar">
|
||||
|
||||
<div class="section-label">
|
||||
共通画面
|
||||
</div>
|
||||
|
||||
<a class="side-menu" th:href="@{/topmenu}">
|
||||
トップメニュー
|
||||
</a>
|
||||
|
||||
<div class="active">
|
||||
パスワード再設定
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- メイン -->
|
||||
<div class="main-area">
|
||||
|
||||
<!-- パンくずリスト -->
|
||||
<div class="breadcrumb">
|
||||
|
||||
<a th:href="@{/topmenu}">
|
||||
トップメニュー
|
||||
</a>
|
||||
|
||||
> パスワード再設定
|
||||
|
||||
</div>
|
||||
|
||||
<h1 class="page-title">
|
||||
パスワード再設定
|
||||
</h1>
|
||||
|
||||
<p class="page-desc">
|
||||
現在のパスワードと新しいパスワードを入力し、
|
||||
「確定」ボタンを押してください。
|
||||
</p>
|
||||
|
||||
<p class="required-note">
|
||||
(※)は必須項目です。
|
||||
</p>
|
||||
|
||||
<div class="content-columns">
|
||||
|
||||
<!-- 左カラム -->
|
||||
<div class="left-column">
|
||||
|
||||
<div class="form-card">
|
||||
|
||||
<h2>
|
||||
パスワード再設定入力
|
||||
</h2>
|
||||
|
||||
<!--
|
||||
簡易実装のため、フォーム送信は行いません。
|
||||
-->
|
||||
<form id="pwForm" onsubmit="return false;">
|
||||
|
||||
<!-- 現在のパスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="currentPassword">
|
||||
現在のパスワード
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="currentPassword"
|
||||
name="currentPassword"
|
||||
autocomplete="current-password"
|
||||
placeholder="現在のパスワードを入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="現在のパスワードの表示を切り替える"
|
||||
onclick="togglePassword('currentPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新しいパスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="newPassword">
|
||||
新しいパスワード
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="newPassword"
|
||||
name="newPassword"
|
||||
autocomplete="new-password"
|
||||
placeholder="新しいパスワードを入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="新しいパスワードの表示を切り替える"
|
||||
onclick="togglePassword('newPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="field-hint">
|
||||
※ 半角英数字・記号を含む8文字以上16文字以下で入力してください。
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 確認用パスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="confirmPassword">
|
||||
新しいパスワードの確認
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
placeholder="新しいパスワードをもう一度入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="確認用パスワードの表示を切り替える"
|
||||
onclick="togglePassword('confirmPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="field-hint">
|
||||
※ 確認のため、もう一度新しいパスワードを入力してください。
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 注意事項 -->
|
||||
<div class="notice-box">
|
||||
|
||||
<div class="notice-title">
|
||||
注意事項
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 操作ボタン -->
|
||||
<div class="button-row">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="goTopMenu()">
|
||||
トップメニューへ戻る
|
||||
</button>
|
||||
|
||||
<div class="btn-group-right">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="clearForm()">
|
||||
クリア
|
||||
</button>
|
||||
|
||||
<!-- ダイアログを表示 -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
onclick="showCompletedPopup()">
|
||||
確定
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 右カラム -->
|
||||
<div class="right-column">
|
||||
|
||||
<div class="constraint-panel">
|
||||
|
||||
<div class="panel-title">
|
||||
パスワードの制約
|
||||
</div>
|
||||
|
||||
<div class="group-label">
|
||||
使用可能文字
|
||||
</div>
|
||||
|
||||
<div class="chars-value">
|
||||
半角英数字・記号
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="group-label">
|
||||
制約
|
||||
</div>
|
||||
|
||||
<ul class="constraint-list">
|
||||
<li>✓ 8文字以上16文字以下</li>
|
||||
<li>✓ 1つ以上の小文字を使用</li>
|
||||
<li>✓ 1つ以上の大文字を使用</li>
|
||||
<li>✓ 1つ以上の数字を使用</li>
|
||||
<li>✓ 1つ以上の記号を使用</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-box">
|
||||
|
||||
<div class="example-label">
|
||||
設定例
|
||||
</div>
|
||||
|
||||
<div class="example-value">
|
||||
Abcdef12!
|
||||
</div>
|
||||
|
||||
<div class="example-note">
|
||||
(9文字、英字大小・数字・記号を含む)
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
© 2026 ShareBooks
|
||||
</div>
|
||||
|
||||
<dialog id="completedDialog">
|
||||
|
||||
<h2>
|
||||
変更完了
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
パスワードの変更が完了しました。
|
||||
</p>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick="goLogin()">
|
||||
完了
|
||||
</button>
|
||||
|
||||
</dialog>
|
||||
|
||||
<script th:src="@{/js/passwordChange.js}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -70,6 +70,16 @@
|
||||
寄贈申請の<br> 受信一覧を確認します。
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<a class="card" href="/">
|
||||
<h3>パスワード変更</h3>
|
||||
|
||||
<p>
|
||||
初期パスワードを<br> 変更します。
|
||||
</p>
|
||||
</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,13 @@
|
||||
<title>図書情報更新入力</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
更新入力画面
|
||||
|
||||
<form method="post" action="updateconfirm">
|
||||
<button type="submit" class="btn-login">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
|
||||
更新内容確認
|
||||
</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
24
src/main/resources/templates/updateConfirm.html
Normal file
24
src/main/resources/templates/updateConfirm.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>更新内容確認</title>
|
||||
</head>
|
||||
<body>
|
||||
更新内容確認画面
|
||||
|
||||
<form method="post" action="update">
|
||||
<button type="submit" class="btn-login">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
|
||||
戻る
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="bookUpdate">
|
||||
<button type="submit" class="btn-login">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
|
||||
更新完了
|
||||
</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user