Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
2396c515
Commit
2396c515
authored
Jan 16, 2025
by
panhong18943
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增登录密码过期
parent
446f72be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
259 additions
and
12 deletions
+259
-12
password_expired_update.lwm
...in/webapp/WEB-INF/classes/sys/password_expired_update.lwm
+33
-0
sys_user_login_with_userid.lwm
...webapp/WEB-INF/classes/sys/sys_user_login_with_userid.lwm
+21
-0
login.html
src/main/webapp/WEB-INF/view/login.html
+205
-12
No files found.
src/main/webapp/WEB-INF/classes/sys/password_expired_update.lwm
0 → 100644
View file @
2396c515
<?xml version="1.0" encoding="UTF-8"?>
<bm:model
xmlns:bm=
"http://www.leaf-framework.org/schema/bm"
needAccessControl=
"false"
>
<bm:operations>
<bm:operation
name=
"execute"
>
<bm:parameters>
<bm:parameter
name=
"password_session_id"
dataType=
"java.lang.String"
input=
"false"
output=
"true"
outputPath=
"/parameter/@password_session_id"
/>
</bm:parameters>
<bm:update-sql>
<![CDATA[
begin
sys_user_pkg.check_password_by_owner(
p_user_name =>
${@user_name},
p_old_password => ${@current_password},
p_new_password => ${@update_password},
p_ip_address => ${/request/@address},
p_password_session_id =>${@password_session_id}
);
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation
name=
"update"
>
<bm:update-sql>
<![CDATA[
begin
sys_user_pkg.change_password_by_owner(
p_user_name =>
${@user_name},
p_old_password => ${@current_password},
p_new_password => ${@update_password},
p_ip_address => ${/request/@address}
);
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
src/main/webapp/WEB-INF/classes/sys/sys_user_login_with_userid.lwm
0 → 100644
View file @
2396c515
<?xml version="1.0" encoding="UTF-8"?>
<bm:model
xmlns:bm=
"http://www.leaf-framework.org/schema/bm"
needAccessControl=
"false"
>
<bm:operations>
<bm:operation
name=
"execute"
>
<bm:parameters>
<bm:parameter
name=
"user_name"
dataType=
"java.lang.String"
input=
"true"
output=
"false"
/>
<bm:parameter
name=
"encryted_session_id"
dataType=
"java.lang.String"
input=
"false"
output=
"true"
outputPath=
"/parameter/@encryted_session_id"
/>
<bm:parameter
name=
"message"
dataType=
"java.lang.String"
input=
"false"
output=
"true"
outputPath=
"/parameter/@message"
/>
</bm:parameters>
<bm:update-sql>
<![CDATA[
begin
sys_login_pkg.expired_password(
p_user_name =>
${@user_name},
p_encryted_session_id =>${@encryted_session_id},
p_error_message =>${@message}
);
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
src/main/webapp/WEB-INF/view/login.html
View file @
2396c515
...
@@ -19,13 +19,56 @@
...
@@ -19,13 +19,56 @@
<link
href=
"${base.contextPath}/lib/assets/global/css/plugins.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"${base.contextPath}/lib/assets/global/css/plugins.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"${base.contextPath}/lib/assets/pages/css/login-5.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"${base.contextPath}/lib/assets/pages/css/login-5.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"${base.contextPath}/lib/assets/global/plugins/jquery.min.js"
type=
"text/javascript"
></script>
<script
src=
"${base.contextPath}/lib/assets/global/plugins/jquery.min.js"
type=
"text/javascript"
></script>
<link
href=
"${base.contextPath}/resources/upload/favicon.png"
rel=
"shortcut icon"
/>
<link
href=
"${base.contextPath}/resources/upload/favicon.png"
rel=
"shortcut icon"
/>
<script
src=
"${base.contextPath}/javascripts/aes.js"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
>
var
_baseContext
=
'${base.contextPath}'
</script>
<script
type=
"text/javascript"
>
var
_baseContext
=
'${base.contextPath}'
</script>
<script
src=
"${base.contextPath}/javascripts/aes.js"
type=
"text/javascript"
></script>
<meta
http-equiv=
"Content-Security-Policy"
content=
"script-src 'self' 'unsafe-inline' */lib;"
>
<meta
http-equiv=
"Content-Security-Policy"
content=
"script-src 'self' 'unsafe-inline' */lib;"
>
<meta
content=
"text/html; charset=UTF-8; X-Content-Type-Options=nosniff"
http-equiv=
"Content-Type"
/>
<meta
content=
"text/html; charset=UTF-8; X-Content-Type-Options=nosniff"
http-equiv=
"Content-Type"
/>
</head>
</head>
<body
class=
" login"
>
<body
class=
" login"
>
<style>
/* 弹窗的样式 */
.modal
{
display
:
none
;
position
:
fixed
;
z-index
:
1
;
left
:
0
;
top
:
0
;
margin-left
:
auto
;
margin-right
:
auto
;
width
:
50%
;
height
:
50%
;
overflow
:
auto
;
padding-top
:
60px
;
}
/* 弹窗内容的样式 */
.modal-content
{
background-color
:
#fefefe
;
margin
:
5%
auto
;
padding
:
20px
;
border
:
1px
solid
#888
;
width
:
80%
;
}
/* 关闭按钮的样式 */
.close
{
color
:
#aaa
;
float
:
right
;
font-size
:
28px
;
font-weight
:
bold
;
}
.close
:hover
,
.close
:focus
{
color
:
black
;
text-decoration
:
none
;
cursor
:
pointer
;
}
</style>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
function
changeCaptchaCode
()
{
function
changeCaptchaCode
()
{
$
(
"#imgObj"
).
attr
(
"src"
,
'${base.contextPath}/verifiCode?_r='
+
Math
.
random
());
$
(
"#imgObj"
).
attr
(
"src"
,
'${base.contextPath}/verifiCode?_r='
+
Math
.
random
());
...
@@ -45,6 +88,118 @@
...
@@ -45,6 +88,118 @@
var
encrypted
=
CryptoJS
.
AES
.
encrypt
(
srcs
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
});
var
encrypted
=
CryptoJS
.
AES
.
encrypt
(
srcs
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
});
//document.getElementById('password').value= encrypted;
//document.getElementById('password').value= encrypted;
}
}
function
checkLogin
(){
var
check
=
true
;
$
.
ajax
({
type
:
'POST'
,
url
:
'${base.contextPath}/autocrud/sys.sys_user_login_with_userid/execute'
,
async
:
false
,
//设为同步
dataType
:
'json'
,
data
:
{
user_name
:
document
.
getElementById
(
'username'
).
value
},
success
:
function
(
res
)
{
debugger
;
if
(
res
.
result
[
'encryted_session_id'
]
==
'ERROR'
)
{
check
=
false
;
}
else
{
check
=
true
;
}
},
error
:
function
()
{
check
=
true
;
}
});
return
check
;
}
window
.
onload
=
function
()
{
// Listen to the double click event.
if
(
window
.
addEventListener
)
{
document
.
getElementById
(
'loginForm'
).
addEventListener
(
'submit'
,
function
(
event
)
{
// 阻止默认提交行为
event
.
preventDefault
();
// 自定义处理逻辑
if
(
checkLogin
())
{
// 如果验证通过,手动提交表单
this
.
submit
();
}
else
{
alert
(
'您的密码已经过期,请修改密码!'
);
//打开修改密码的弹窗
document
.
getElementById
(
"user_name"
).
value
=
document
.
getElementById
(
'username'
).
value
.
toUpperCase
();
document
.
getElementById
(
"user_name"
).
readOnly
=
true
;
var
modal
=
document
.
getElementById
(
"passwordModal"
);
modal
.
style
.
display
=
"block"
;
}
});
document
.
getElementById
(
'passwordForm'
).
addEventListener
(
'submit'
,
function
(
event
)
{
// 阻止默认提交行为
event
.
preventDefault
();
// 自定义处理逻辑
if
(
checkUpdatePassword
())
{
alert
(
'修改成功'
);
// 如果验证通过,手动提交表单
window
.
top
.
location
=
"${base.contextPath}/login"
;
}
});
};
};
//关闭弹窗
function
closeModal
(){
var
modal
=
document
.
getElementById
(
"passwordModal"
);
modal
.
style
.
display
=
"none"
;
document
.
getElementById
(
"current_password"
).
value
=
""
;
document
.
getElementById
(
"update_password"
).
value
=
""
;
document
.
getElementById
(
"confirm_password"
).
value
=
""
;
}
//修改密码
function
checkUpdatePassword
(){
var
username
=
document
.
getElementById
(
'username'
).
value
;
var
current_password
=
document
.
getElementById
(
'current_password'
).
value
;
var
update_password
=
document
.
getElementById
(
'update_password'
).
value
;
var
confirm_password
=
document
.
getElementById
(
'confirm_password'
).
value
;
var
check
=
true
;
if
(
update_password
!=
confirm_password
){
alert
(
'新密码和确认密码不一致'
);
check
=
false
;
return
check
;
}
$
.
ajax
({
type
:
'POST'
,
url
:
'${base.contextPath}/autocrud/sys.password_expired_update/execute'
,
async
:
false
,
//设为同步
dataType
:
'json'
,
data
:
{
user_name
:
username
,
current_password
:
document
.
getElementById
(
'current_password'
).
value
,
update_password
:
document
.
getElementById
(
'update_password'
).
value
},
success
:
function
(
res
)
{
debugger
;
if
(
res
.
result
[
'password_session_id'
]
==
'校验成功'
)
{
check
=
true
;
}
else
{
alert
(
res
.
result
[
'password_session_id'
]);
check
=
false
;
}
},
error
:
function
()
{
check
=
false
;
}
});
return
check
;
}
</script>
</script>
<style>
<style>
.user-login-5
input
:-webkit-autofill
{
.user-login-5
input
:-webkit-autofill
{
...
@@ -73,9 +228,9 @@
...
@@ -73,9 +228,9 @@
<div
class=
"login-content"
>
<div
class=
"login-content"
>
<div
class=
"login-icon"
>
<div
class=
"login-icon"
>
<!-- <img src="${base.contextPath}/lib/assets/pages/img/login/icon@2x.png" style="height: 28px">-->
<!-- <img src="${base.contextPath}/lib/assets/pages/img/login/icon@2x.png" style="height: 28px">-->
</div>
</div>
<form
id=
"loginForm"
class=
"login-form"
action=
"login"
method=
"post"
autocomplete=
"off"
>
<form
id=
"loginForm"
name=
"loginForm"
class=
"login-form"
action=
"login"
method=
"post"
autocomplete=
"off"
>
<div
class=
"form-title"
>
<div
class=
"form-title"
>
<img
src=
"${base.contextPath}/lib/assets/pages/img/login/icon@2x.png"
style=
"height: 24px"
>
<img
src=
"${base.contextPath}/lib/assets/pages/img/login/icon@2x.png"
style=
"height: 24px"
>
<p
style=
"font-size: 18px;font-weight: bold;"
>
宏菱建机融资租赁管理平台
</p>
<p
style=
"font-size: 18px;font-weight: bold;"
>
宏菱建机融资租赁管理平台
</p>
...
@@ -95,7 +250,7 @@
...
@@ -95,7 +250,7 @@
</
#
if>
</
#
if>
<div
class=
"form-input"
>
<div
class=
"form-input"
>
<input
class=
"form-control form-control-solid placeholder-no-fix"
type=
"text"
<input
class=
"form-control form-control-solid placeholder-no-fix"
type=
"text"
autocomplete=
"off"
placeholder=
"请输入用户名"
name=
"username"
/>
autocomplete=
"off"
placeholder=
"请输入用户名"
name=
"username"
id=
"username"
/>
</div>
</div>
<div
class=
"form-input"
>
<div
class=
"form-input"
>
<input
class=
"form-control form-control-solid placeholder-no-fix "
placeholder=
"密码"
<input
class=
"form-control form-control-solid placeholder-no-fix "
placeholder=
"密码"
...
@@ -131,14 +286,52 @@
...
@@ -131,14 +286,52 @@
</form>
</form>
</div>
</div>
<!-- <table width="340" cellspacing="0" cellpadding="0" style="margin-top: 30px">-->
<div
id=
"passwordModal"
class=
"modal"
style=
"width: 500px; height: 530px"
>
<!-- <tr>-->
<div
class=
"modal-content"
>
<!-- <td> 该网站的使用仅限于宏菱建机员工以及得到许可的用户。-->
<span
class=
"close"
onclick=
"closeModal()"
>
×
</span>
<!-- 系统正在监督及保存所有系统内用户登录记录。-->
<form
id=
"passwordForm"
name=
"passwordForm"
action=
""
method=
"post"
>
<!-- <strong>非法使用者</strong>根据相关法律需要承担民刑事的责任。-->
<label>
账号:
</label>
<!-- </td>-->
<input
class=
"form-control form-control-solid placeholder-no-fix"
type=
"text"
<!-- </tr>-->
autocomplete=
"off"
name=
"user_name"
id=
"user_name"
/>
<!-- </table>-->
<br/>
<label>
原密码:
</label>
<input
class=
"form-control form-control-solid placeholder-no-fix"
type=
"text"
autocomplete=
"off"
name=
"current_password"
id=
"current_password"
required
/>
<br/>
<label
>
新密码:
</label>
<input
class=
"form-control form-control-solid placeholder-no-fix"
type=
"text"
autocomplete=
"off"
name=
"update_password"
id=
"update_password"
required
/>
<br/>
<label
>
确认密码:
</label>
<input
class=
"form-control form-control-solid placeholder-no-fix"
type=
"text"
autocomplete=
"off"
name=
"confirm_password"
id=
"confirm_password"
required
/>
<br/>
<div
class=
"button-login"
>
<button
class=
"btn blue"
type=
"submit"
style=
"min-width:100%;width: 100%;"
>
确认
</button>
</div>
</form>
</div>
</div>
<script
type=
"text/javascript"
>
$
(
'#current_password'
).
on
(
'focus'
,
function
()
{
$
(
this
).
attr
(
'type'
,
'password'
);
})
$
(
'#update_password'
).
on
(
'focus'
,
function
()
{
$
(
this
).
attr
(
'type'
,
'password'
);
})
$
(
'#confirm_password'
).
on
(
'focus'
,
function
()
{
$
(
this
).
attr
(
'type'
,
'password'
);
})
</script>
<!-- <table width="340" cellspacing="0" cellpadding="0" style="margin-top: 30px">-->
<!-- <tr>-->
<!-- <td> 该网站的使用仅限于宏菱建机员工以及得到许可的用户。-->
<!-- 系统正在监督及保存所有系统内用户登录记录。-->
<!-- <strong>非法使用者</strong>根据相关法律需要承担民刑事的责任。-->
<!-- </td>-->
<!-- </tr>-->
<!-- </table>-->
<div
class=
"login-footer"
style=
"position: fixed;bottom: 10px;right: 10px;"
>
<div
class=
"login-footer"
style=
"position: fixed;bottom: 10px;right: 10px;"
>
<div
class=
"row bs-reset"
>
<div
class=
"row bs-reset"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment