<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@ page import="jp.co.canon_soft.wp.runtime.AppContext"%>
<%@ page
import="java.text.SimpleDateFormat, java.util.Date, java.util.Locale, java.util.Calendar"%>
<%@ page contentType="text/html; charset=UTF-8"
import="org.apache.commons.lang.*"
import="jakarta.servlet.http.HttpSession"
import="jp.co.canon_soft.wp.runtime.util.*"
import="filter.Certification" import="security.LoginCheck"
import="java.util.*" import="util.StringUtil"%>
<%
String ctxPath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
href="<%=ctxPath%>/font-awesome/css/font-awesome.css" />
<script
src="<%=AppContext.getContextPath()%>/components/searchView/script/jquery-3.7.1.min.js"
type="text/javascript"></script>
</head>
<%
Date now = new Date();
String historicalTime = StringUtil.seirekiToWareki(now, "1");
%>
<body onload="setFocus()">
<style type="text/css">
/* メッセージ */
.info-icon {
display: inline-block;
width: 20px;
height: 20px;
background-image: url(../image/msg_info.gif);
margin-right: 3px;
}
.info-text {
color: blue;
font-weight: bold;
}
.warn-icon {
display: inline-block;
width: 20px;
height: 20px;
background-image: url(../image/msg_alert.gif);
margin-right: 3px;
}
.warn-text {
color: tomato;
font-weight: bold;
}
.errors-icon {
display: inline-block;
width: 20px;
height: 20px;
background-image: url(../image/msg_error.gif);
margin-right: 3px;
}
.errors-text {
color: red;
font-weight: bold;
}
.topBody {
background-color: #EEEEEE;
text-align: center;
margin: 0;
padding: 0 0 20px;
}
.topContainerInner {
text-align: left;
padding: 0 30px 30px;
}
.topContainerInner>div:first-child {
padding-left: 450px;
}
.topContainerInner h1 {
color: #fff;
background: linear-gradient(120deg, rgba(1, 62, 125, 1.00) 0%,
rgba(8, 89, 171, 1.00) 100%);
border: 1px solid #024D99;
border-radius: 6px;
font-size: 15px;
font-weight: normal;
line-height: 1.3;
letter-spacing: 1px;
padding: 9px 20px 7px 0px;
margin: 20px 0 10px;
position: relative;
padding-left: 28px;
}
.topContainerInner h1::before {
content: "";
display: block;
position: absolute;
left: 15px;
top: 50%;
width: 8px;
height: 8px;
background-color: #ED6D00;
border-radius: 1px;
margin: -4px 0 0 0;
}
.topHeaderTitle {
margin: 0;
padding: 18px 70px 14px;
line-height: 1;
color: #fff;
font-weight: 500;
font-size: 27px;
border-top: none;
border-radius: 0 0 10px 10px;
display: inline-block;
background: linear-gradient(180deg, rgba(1, 43, 98, 1.00) 0%,
rgba(16, 72, 145, 1.00) 100%);
letter-spacing: 3px;
font-family: Arial, Helvetica, "sans-serif";
}
.topHeaderDate {
width: 159px;
height: 43px;
/*background-color: #f0f8ff;*/ /* 背景色 */
/*border: 0.5px solid #4682b4;*/ /* ?框 */
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
font-family: Arial, Helvetica, "sans-serif";
/*color: #333;*/
text-align: right;
margin-top: 50px;
border: 1px solid #5483BA;
font-size: 14px;
color: #074D99;
border-radius: 100px;
line-height: 1;
background-color: #F6F6F6;
}
.topHeaderDate:before {
content: "\f073";
font-family: FontAwesome;
margin-right: 10px;
color: #EB7D42;
}
.login-container {
width: 900px;
margin: 7px auto;
padding: 30px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
background-color: #fff;
}
.login-header {
text-align: center;
margin-bottom: 20px;
}
.login-form div {
margin-bottom: 6px;
display: flex;
align-items: center;
}
.login-form label {
width: 120px;
margin-right: 10px;
text-align: right;
}
.login-form input[type="text"], .login-form input[type="password"] {
flex: 1;
padding: 10px;
box-sizing: border-box;
}
.login-form input[type="submit"]:hover {
background-color: #0056b3;
}
.login-message {
color: red;
margin-bottom: 15px;
}
.password {
padding-left: 20px;
}
.okButton {
border-radius: 8px;
height: 50px;
width: 175px;
text-align: center;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
margin-left: -68px;
padding-right: 15px;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.25);
color: #fff;
font-size: 20px;
background: linear-gradient(180deg, rgba(1, 62, 125, 1.00) 0%,
rgba(2, 77, 153, 1.00) 100%);
border: 1px solid #07336A;
border-top-color: #3E70AF;
border-left-color: #3E70AF;
}
.okButton::before {
content: "\f084";
font-family: FontAwesome;
margin-right: 10px;
font-weight: normal;
font-size: 22px;
}
.quitButton {
border-radius: 14px;
height: 50px;
width: 175px;
text-align: center;
margin: 5px;
padding-right: 15px;
transition: all 0.3s;
border: 1px solid #07336A;
border-top-color: #3E70AF;
border-left-color: #3E70AF;
color: #024D99;
font-size: 20px;
background: linear-gradient(180deg, rgba(236, 236, 236, 1.00) 0%,
rgba(246, 246, 246, 1.00) 90%);
}
.quitButton:before {
content: "\f00d";
font-family: FontAwesome;
margin-right: 10px;
font-weight: normal;
font-size: 22px;
}
.closeDialog {
width: 130px;
padding: 5px 8px 6px 5px;
text-align: center;
color: #fff;
margin-right: 15px;
background-color: #024d99;
border: 1px solid #fff;
border-radius: 6px;
font-size: 15px;
height: 34px;
transition: background-color .3s;
}
.closeDialog:before {
content: "\f00d";
font-family: FontAwesome;
margin-right: 10px;
font-weight: normal;
font-size: 22px;
}
.okDialog {
width: 130px;
text-align: center;
color: #fff;
margin-right: 15px;
background-color: #024d99;
border: 1px solid #fff;
border-radius: 6px;
font-size: 15px;
height: 34px;
transition: background-color .3s;
}
.okDialog:before {
content: "\f00c";
font-family: FontAwesome;
margin-right: 10px;
font-weight: normal;
font-size: 22px;
}
.passButton {
width: 115px;
height: 29px;
color: #024D99;
background: linear-gradient(180deg, rgba(236, 236, 236, 1.00) 0%,
rgba(246, 246, 246, 1.00) 90%);
}
.loginFormData {
flex-direction: column;
/*padding: 20px 10px 0;*/
margin-left: 100px;
}
.loginFormData dt {
font-size: 20px;
color: #024D99;
float: left;
width: 150px;
padding: 20px 10px 0;
}
.loginFormData dd {
margin: 0;
padding: 10px 10px 10px 150px;
}
.loginFormData input {
background: #FFFFFF;
border: 1px solid #979797;
box-shadow: inset 1px 1px 4px 0 rgba(0, 0, 0, 0.22);
border-radius: 6px;
font-size: 20px;
height: 42px !important;
width: 280px !important;
padding: 0 0 0 0;
}
.loginFormData .ErrorMessage {
padding: 1px 0;
}
.loginFormData.changePwData dt {
width: 240px;
}
.loginFormData.changePwData dd {
padding: 10px 10px 10px 240px;
}
.btnTopLogin, .btnTopQuit, .btnChangePw, .btnTopPW, .topHeaderMenu a,
.btnLatestSituation, .bt_sub {
-moz-transition: background-color 0.3s;
-o-transition: background-color 0.3s;
-webkit-transition: background-color 0.3s;
transition: background-color 0.3s;
width: 120px;
}
.btnTopLogin:hover, .btnTopPW:hover, .bt_sub:hover, .topHeaderMenu a:hover
{
opacity: 0.7;
}
/*.btnTopLogin,
.btnTopPW {
color: #fff;
font-size: 20px;
background : linear-gradient(180deg, rgba(1,62,125,1.00) 0%, rgba(2,77,153,1.00) 100%);
border-top-color: #3E70AF;
border-left-color: #3E70AF;
}
.btnTopQuit {
border: 1px solid #07336A;
border-top-color: #3E70AF;
border-left-color: #3E70AF;
color: #024D99;
font-size: 20px;
background : linear-gradient(180deg, rgba(236,236,236,1.00) 0%, rgba(246,246,246,1.00) 90%);
}
.btnTopQuit:before {
content: "\f00d";
font-family: FontAwesome;
margin-right: 10px;
font-weight: normal;
font-size: 22px;
}*/
.loginFormBtn {
list-style: none;
margin: 20px;
padding: 0;
display: flex;
justify-content: center;
column-gap: 20px;
}
.loginFormBtn li {
margin: 5px;
}
.cautionList {
list-style: none;
margin: 0px 0;
padding: 0;
font-size: 14px;
color: #144D67;
}
.cautionList>li {
margin: 0 0 0 5px;
padding: 0 0 0 18px;
text-indent: -18px;
}
/* 遮罩层样式 */
#overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
}
/* 对话框样式 */
#dialog {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 20px;
border: 1px solid #ccc;
z-index: 1000;
cursor: move;
border-width: 4px;
border-style: solid;
border-color: #024d99;
background-color: #fff;
min-height: 170px;
min-width: 530px;
max-height: 100%;
max-width: 100%;
border-radius: 20px;
padding-bottom: 20px;
}
.MessageBoxTitle {
padding: 1px;
text-align: left;
color: #fbfff9;
font-size: 14px;
height: 32px;
}
</style>
<form id="myForm" name="myPassword"
action="<%=request.getContextPath()%>/servlet/PassWordServlet"
method="POST">
<input type="hidden" name="action" value="dologin">
<div class="topContainerInner">
<div>
<div class="topHeaderTitle">財務会計コアシステム</div>
</div>
<div style="text-align: right; padding-left: 1244px;">
<div class="topHeaderDate"><%=historicalTime%></div>
</div>
<div class="login-container">
<div class="login-header">
<div style="text-align: left;">
<h1>パスワード変更</h1>
</div>
</div>
<dd class="ErrorMessage">
<label id="ErrMsg"></label>
</dd>
<dl class="loginFormData changePwData">
<dt>ユーザID</dt>
<dd>
<input id="userId" type="text" name="userId" maxlength="10"
autocomplete="off"></input>
</dd>
<dt class="ErrorMessage"></dt>
<dd class="ErrorMessage">
<label id="lblUserIdErrMsg"
style="color: red; font-size: 8pt; padding-left: 20px"></label>
</dd>
<dt>旧パスワード</dt>
<dd>
<input id="oldPassword" type="password" name="oldPassword"
maxlength="20" autocomplete="new-password"></input>
</dd>
<dt class="ErrorMessage"></dt>
<dd class="ErrorMessage">
<label id="lblOldPassErrMsg"
style="color: red; font-size: 8pt; padding-left: 20px"></label>
</dd>
<dt>新パスワード</dt>
<dd>
<input id="newPassword" type="password" name="newPassword"
maxlength="20" autocomplete="new-password"></input>
</dd>
<dt class="ErrorMessage"></dt>
<dd class="ErrorMessage">
<label id="lblNewPass1ErrMsg"
style="color: red; font-size: 8pt; padding-left: 20px"></label>
</dd>
<dt>新パスワード(再入力)</dt>
<dd>
<input id="newPassword2" type="password" name="newPassword2"
maxlength="20" autocomplete="new-password"></input>
</dd>
<dt class="ErrorMessage"></dt>
<dd class="ErrorMessage">
<label id="lblNewPass2ErrMsg"
style="color: red; font-size: 8pt; padding-left: 20px"></label>
</dd>
</dl>
<svg width="100%" height="10">
<line x1="100" y1="5" x2="90%" y2="5" stroke="black"
stroke-width="0.5" stroke-dasharray="5,1" />
</svg>
<div class="topContainerCaution">
<ul class="cautionList" style="margin-left: 100px;">
<li>※パスワード変更に関する注意<br> ・パスワードは、8文字以上、10文字以内で入力してください。<br>
・パスワードに使用できる文字種: 「半角英大文字」 「半角英小文字」 「半角数字」 「記号」<br>
・パスワードに使用できる記号は、次の文字になります。<br> 記号: ` ~ ! @ # $
% ^ & * ( ) _ - + = { } [ ] \ | : ; " ' < > , . ? / 及び 半角スペース<br>
・新パスワードに、変更前(旧パスワード)及び前回の変更前と同じパスワードを設定することはできません。<br>
・入力文字は次の要素を全て満たして下さい。<br> ①半角英字含める(大文字小文字を混在させる)<br>
②アラビア数字を含める<br> ③特殊文字を含める 特殊文字: ! " # $ % & ' ( ) - = ^ ~ \
| @ [ { ] } ; + : * , < . > / ? _<br> ④ログイン名/名前は含めない<br>
・パスワードは、生年月日や家族の名前、ありふれた文字の連続等、推測の容易な内容を使用しないで下さい。<br>
・パスワードは本人のみが知り得る情報である必要があります。<br>
・個人で利用しているアカウント等のパスワードと、同じ内容は利用しないで下さい。<br>
</li>
</ul>
</div>
<div class="loginFormBtn">
<div class="btnTopLogin">
<button type="button" class="okButton" onclick="openDialog()">OK</button>
</div>
<!-- 遮罩层 -->
<div id="overlay"></div>
<!-- 对话框 -->
<div id="dialog">
<div class="MessageBoxTitle" style="cursor: move;">
<td colspan="2"><span id="MessageBox_lblTitle"
style="padding-left: 13px; display: block; width: 100%; color: blue;"> </span></td>
</div>
<div>
<p>パスワードを変更しても宜しいですか。</p>
</div>
<button type="button" class="okDialog" onclick="okDialog()"
style="position: absolute; bottom: 0; left: 40%; transform: translateX(-50%); margin-right: 10px;">はい</button>
<button type="button" class="closeDialog" onclick="closeDialog()"
style="position: absolute; bottom: 0; left: 40%; transform: translateX(50%);">いいえ</button>
</div>
<div class="btnTopQuit">
<button type="button" class="quitButton"
onclick="buttonQUITPage()">QUIT</button>
</div>
</div>
<div style="width: 100%; display: flex;">
<div
style="width: 50%; text-align: left; margin-left: 50px; font-size: 12px">
Ver.1.0.1</div>
<div style="padding-left: 258px; font-size: 12px">
画面ID:CMP010DI</div>
</div>
</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function() {
var msg = '<%=request.getAttribute("error")%>';
if(msg!=null && msg.trim().length > 0){
var json = JSON.parse(msg);
if(json.msg){
if(json.msg[0] == '認証成功'){
buttonQUITPage()
}else{
var html = "";
json.msg.forEach(item=>{
html += item + '<br>'
})
$("#ErrMsg").html(html)
$("#ErrMsg").css("color","red")
}
}
if(json.lblUserIdErrMsg||json.lblOldPassErrMsg){
if(json.lblUserIdErrMsg){
$("#lblUserIdErrMsg").text(json.lblUserIdErrMsg[0])
$("#userId").css("background-color","red")
}
if(json.lblOldPassErrMsg){
$("#lblOldPassErrMsg").text(json.lblOldPassErrMsg[0])
$("#oldPassword").css("background-color","red")
}
}else if(json.lblNewPass1ErrMsg||json.lblNewPass2ErrMsg){
if(json.lblNewPass1ErrMsg){
$("#lblNewPass1ErrMsg").text(json.lblNewPass1ErrMsg[0])
$("#newPassword").css("background-color","red")
}
if(json.lblNewPass2ErrMsg){
$("#lblNewPass2ErrMsg").text(json.lblNewPass2ErrMsg[0])
$("#newPassword2").css("background-color","red")
}
}
}
});
function setFocus() {
document.getElementById("userId").focus();
}
function buttonQUITPage() {
window.location.href = "/FinancialCoreSystem/page/login.jsp";
}
function openDialog() {
// 显示遮罩层
document.getElementById('overlay').style.display = 'block';
// 显示对话框
document.getElementById('dialog').style.display = 'block';
}
function closeDialog() {
// 隐藏遮罩层
document.getElementById('overlay').style.display = 'none';
// 隐藏对话框
document.getElementById('dialog').style.display = 'none';
}
// 实现对话框可移动
let isDragging = false;
let offsetX, offsetY;
const dialog = document.getElementById('dialog');
dialog.addEventListener('mousedown', (e) => {
isDragging = true;
offsetX = e.clientX - dialog.offsetLeft;
offsetY = e.clientY - dialog.offsetTop;
});
document.addEventListener('mousemove', (e) => {
if (isDragging) {
dialog.style.left = (e.clientX - offsetX) + 'px';
dialog.style.top = (e.clientY - offsetY) + 'px';
}
});
document.addEventListener('mouseup', () => {
isDragging = false;
});
function okDialog() {
document.querySelector('.okDialog').addEventListener('click', function() {
document.getElementById('myForm').submit();
});
}
</script>
</body>
</html>加工这个代码实现