Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
e44766b1
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e44766b1
编写于
10月 25, 2021
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
login.js
上级
44aedebb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
146 addition
and
144 deletion
+146
-144
ReleaseNotes.txt
ReleaseNotes.txt
+6
-4
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/layout/common.cssjs.ftl
...rc/main/resources/templates/views/layout/common.cssjs.ftl
+1
-1
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/login.ftl
...y-web-maxkey/src/main/resources/templates/views/login.ftl
+1
-138
maxkey-webs/maxkey-web-resources/src/main/resources/static/css/base.css
...xkey-web-resources/src/main/resources/static/css/base.css
+24
-1
maxkey-webs/maxkey-web-resources/src/main/resources/static/javascript/login.js
...b-resources/src/main/resources/static/javascript/login.js
+114
-0
未找到文件。
ReleaseNotes.txt
浏览文件 @
e44766b1
...
...
@@ -12,7 +12,7 @@
*(MAXKEY-210811) 密码修改问题修复
*(MAXKEY-210812) 环境变量参数优化
*(MAXKEY-210813) 管理端图标显示修复
*(MAXKEY-210814)
管理端‘应用管理’移动到‘配置管理’的菜单项
*(MAXKEY-210814)
认证系统菜单项调整
*(MAXKEY-210815) OAuth的数据库加载增加本地缓存
*(MAXKEY-210816) 社交账号登录改为存储在数据库中,方便用户更改
*(MAXKEY-210817) 账号策略管理及动态适配
...
...
@@ -21,13 +21,15 @@
*(MAXKEY-210820) 企业微信扫码登录js更新wwLogin-1.2.4.js
*(MAXKEY-210821) 中文切换调整为下拉菜单
*(MAXKEY-210822) 移除原有的缓存方案
*(MAXKEY-210823) 应用管理OAuth适配器显示问题修复
*(MAXKEY-210823) 应用管理OAuth适配器显示问题修复
*(MAXKEY-210824) 图片验证码优化,增加随机颜色的字符生成实现,干扰线优化
*(MAXKEY-210825) 依赖jar引用、更新和升级
*(MAXKEY-210825) 菜单名称的调整
*(MAXKEY-210826) JS脚本整合优化
*(MAXKEY-210827) 依赖jar引用、更新和升级
spring 5.3.12
springboot 2.5.6
tomcat 9.0.54
springSecurity 5.5.3
springSecurity 5.5.3
springData 2.5.5
springSession 2.5.3
mybatis-jpa-extra 2.6
...
...
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/layout/common.cssjs.ftl
浏览文件 @
e44766b1
<!-- javascript js begin -->
<script type="text/javascript">var webContextPath = "<@base />";var webLocale = '<@locale/>';</script>
<script type="text/javascript">var webContextPath = "<@base />";var webLocale = '<@locale/>';
var currentDate= new Date('${.now}');
</script>
<#-- jquery base -->
<script src ="<@base />/static/javascript/jquery-3.6.0.min.js" type="text/javascript"></script>
<script src ="<@base />/static/javascript/popper.min.js" type="text/javascript" ></script>
...
...
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/login.ftl
浏览文件 @
e44766b1
...
...
@@ -3,12 +3,7 @@
<head>
<
#include
"
layout
/
header.ftl
"
>
<
#include
"
layout
/
common.cssjs.ftl
"
>
<style>
.wrapper
{
position
:
relative
;
}
i
.fa
{
position
:
absolute
;
top
:
5px
;
left
:
5px
;
font-size
:
22px
;
color
:
gray
;}
.wrapper
input
{
text-indent
:
20px
;}
</style>
<script
src =
"<@base />/static/javascript/login.js"
type=
"text/javascript"
></script>
<
#if
true=
=isKerberos
>
<
@
browser
name=
"MSIE"
>
...
...
@@ -25,138 +20,6 @@
</script>
</
@
browser>
</
#
if>
<script
type=
"text/javascript"
>
<
#
--
resend
captcha
code
Interval
-->
var
captchaCountTimer
;
var
captchaCount
=
60
;
function
getCaptchaCount
(){
$
(
"
#mobile_j_otp_captcha_button
"
).
val
(
"
<@locale code=
"
login
.
text
.
login
.
mobile
.
obtain
.
valid
"
/>(
"
+
captchaCount
+
"
)<@locale code=
"
login
.
text
.
login
.
mobile
.
obtain
.
valid
.
unit
"
/>
"
);
captchaCount
--
;
if
(
captchaCount
==
0
){
$
(
"
#mobile_j_otp_captcha_button
"
).
val
(
"
<@locale code=
"
login
.
text
.
login
.
mobile
.
obtain
"
/>
"
);
captchaCount
=
60
;
clearInterval
(
captchaCountTimer
);
}
}
<
#
--
current
datetime
-->
var
currentDate
=
new
Date
(
'
${.now}
'
);
var
fullYear
=
currentDate
.
getFullYear
();
var
month
=
currentDate
.
getMonth
()
+
1
;
var
date
=
currentDate
.
getDate
();
var
hours
=
currentDate
.
getHours
();
var
minutes
=
currentDate
.
getMinutes
();
var
seconds
=
currentDate
.
getSeconds
();
var
strTime
=
""
;
function
formatTime
(){
strTime
=
fullYear
+
"
-
"
;
strTime
+=
(
month
<
10
?
"
0
"
+
month
:
month
)
+
"
-
"
;
strTime
+=
(
date
<
10
?
"
0
"
+
date
:
date
)
+
"
"
;
strTime
+=
(
hours
<
10
?
"
0
"
+
hours
:
hours
)
+
"
:
"
;
strTime
+=
(
minutes
<
10
?
"
0
"
+
minutes
:
minutes
)
+
"
:
"
;
strTime
+=
(
seconds
<
10
?
"
0
"
+
seconds
:
seconds
);
}
<
#
if
true
==
isMfa
&&
"
TOPT
"
==
otpType
>
function
currentTime
(){
seconds
++
;
if
(
seconds
>
59
){
minutes
++
;
seconds
=
0
;
}
if
(
minutes
>
59
){
hours
++
;
minutes
=
0
;
}
if
(
hours
>
23
){
date
++
;
hours
=
0
;
}
formatTime
();
//for timebase token
getTimeBaseCount
();
$
(
"
#currentTime
"
).
val
(
strTime
);
}
<
#
--
timeBase
Token
Interval
default
is
30
s
-->
var
timeBaseCount
;
function
getTimeBaseCount
(){
if
(
seconds
<
$
{
otpInterval
}){
timeBaseCount
=
$
{
otpInterval
}
-
seconds
;
}
else
{
timeBaseCount
=
$
{
otpInterval
}
-
(
seconds
-
$
{
otpInterval
});
}
$
(
"
#tfa_j_otp_captcha_button
"
).
val
(
"
<@locale code=
"
login
.
text
.
login
.
twofactor
.
validTime
"
/>(
"
+
timeBaseCount
+
"
)<@locale code=
"
login
.
text
.
login
.
twofactor
.
validTime
.
unit
"
/>
"
);
};
<
/#if
>
var
currentSwitchTab
=
"
normalLogin
"
;
<
#
--
submit
form
-->
function
doLoginSubmit
(){
$
.
cookie
(
"
mxk_login_username
"
,
$
(
"
#
"
+
currentSwitchTab
+
"
Form input[name=username]
"
).
val
(),
{
expires
:
7
});
$
(
"
#
"
+
currentSwitchTab
+
"
SubmitButton
"
).
click
();
$
.
cookie
(
"
mxk_login_switch_tab
"
,
currentSwitchTab
,
{
expires
:
7
});
};
<
#
--
switch
Login
Form
-->
function
switchTab
(
id
){
if
(
$
(
"
#
"
+
id
+
"
Form input[name=username]
"
).
val
()
==
""
){
$
(
"
#
"
+
id
+
"
Form input[name=username]
"
).
focus
();
}
else
{
$
(
"
#
"
+
id
+
"
Form input[name=password]
"
).
focus
();
}
currentSwitchTab
=
id
;
}
<
#
--
when
press
ENTER
key
,
do
form
submit
-->
document
.
onkeydown
=
function
(
event
){
var
e
=
event
||
window
.
event
||
arguments
.
callee
.
caller
.
arguments
[
0
];
if
(
e
&&
e
.
keyCode
==
13
){
doLoginSubmit
();
};
};
$
(
function
(){
<
#
if
true
==
isMfa
&&
"
TOPT
"
==
otpType
>
setInterval
(
"
currentTime()
"
,
1000
);
<
/#if
>
<
#
--
submit
loginForme
-->
$
(
"
.doLoginSubmit
"
).
on
(
"
click
"
,
function
(){
doLoginSubmit
();
});
var
cookieLoginUsername
=
$
.
cookie
(
"
mxk_login_username
"
);
<
#
--
read
username
cookie
for
login
e
-->
if
(
cookieLoginUsername
!=
undefined
&&
cookieLoginUsername
!=
""
){
var
switch_tab
=
$
.
cookie
(
"
mxk_login_switch_tab
"
)
==
undefined
?
"
normalLogin
"
:
$
.
cookie
(
"
mxk_login_switch_tab
"
);
$
(
"
#
"
+
switch_tab
).
click
();
$
(
"
#
"
+
switch_tab
+
"
Form input[name=username]
"
).
val
(
cookieLoginUsername
==
undefined
?
""
:
cookieLoginUsername
);
$
(
"
#div_
"
+
switch_tab
+
"
input[name=password]
"
).
focus
();
}
else
{
$
(
"
#div_normalLogin input[name=username]
"
).
focus
();
}
<
#
--
resend
captchae
-->
$
(
"
#mobile_j_otp_captcha_button
"
).
on
(
"
click
"
,
function
(){
if
(
captchaCount
<
60
){
return
;
}
var
loginName
=
$
(
"
#mobile_j_username
"
).
val
();
if
(
loginName
==
""
){
return
;
}
$
.
get
(
"
<@base />/login/sendsms/
"
+
loginName
,
function
(
data
,
status
){
//alert("Data: " + data + "\nStatus: " + status);
});
<
#
--
todo
:
send
captcha
-->
captchaCountTimer
=
setInterval
(
"
getCaptchaCount()
"
,
1000
);
});
});
</script>
</head>
<body
>
<div
id=
"top"
>
...
...
maxkey-webs/maxkey-web-resources/src/main/resources/static/css/base.css
浏览文件 @
e44766b1
...
...
@@ -380,4 +380,27 @@ body{
.float-left
{
float
:
left
;
}
\ No newline at end of file
}
#div_normalLogin
.wrapper
,
#div_tfaLogin
.wrapper
,
#div_mobileLogin
.wrapper
{
position
:
relative
;
}
#div_normalLogin
.wrapper
input
,
#div_tfaLogin
.wrapper
input
,
#div_mobileLogin
.wrapper
input
{
text-indent
:
20px
;
}
#div_normalLogin
.wrapper
i
.fa
,
#div_tfaLogin
.wrapper
i
.fa
,
#div_mobileLogin
.wrapper
i
.fa
{
position
:
absolute
;
top
:
5px
;
left
:
5px
;
font-size
:
22px
;
color
:
gray
;
}
maxkey-webs/maxkey-web-resources/src/main/resources/static/javascript/login.js
0 → 100644
浏览文件 @
e44766b1
var
captchaCountTimer
;
var
captchaCount
=
60
;
function
getCaptchaCount
(){
$
(
"
#mobile_j_otp_captcha_button
"
).
val
(
"
重新获取(
"
+
captchaCount
+
"
)秒
"
);
captchaCount
--
;
if
(
captchaCount
==
0
){
$
(
"
#mobile_j_otp_captcha_button
"
).
val
(
"
发送验证码
"
);
captchaCount
=
60
;
clearInterval
(
captchaCountTimer
);
}
}
var
fullYear
=
currentDate
.
getFullYear
();
var
month
=
currentDate
.
getMonth
()
+
1
;
var
date
=
currentDate
.
getDate
();
var
hours
=
currentDate
.
getHours
();
var
minutes
=
currentDate
.
getMinutes
();
var
seconds
=
currentDate
.
getSeconds
();
var
strTime
=
""
;
function
formatTime
(){
strTime
=
fullYear
+
"
-
"
;
strTime
+=
(
month
<
10
?
"
0
"
+
month
:
month
)
+
"
-
"
;
strTime
+=
(
date
<
10
?
"
0
"
+
date
:
date
)
+
"
"
;
strTime
+=
(
hours
<
10
?
"
0
"
+
hours
:
hours
)
+
"
:
"
;
strTime
+=
(
minutes
<
10
?
"
0
"
+
minutes
:
minutes
)
+
"
:
"
;
strTime
+=
(
seconds
<
10
?
"
0
"
+
seconds
:
seconds
);
}
function
currentTime
(){
seconds
++
;
if
(
seconds
>
59
){
minutes
++
;
seconds
=
0
;
}
if
(
minutes
>
59
){
hours
++
;
minutes
=
0
;
}
if
(
hours
>
23
){
date
++
;
hours
=
0
;
}
formatTime
();
//for timebase token
getTimeBaseCount
();
$
(
"
#currentTime
"
).
val
(
strTime
);
}
var
timeBaseCount
;
function
getTimeBaseCount
(){
if
(
seconds
<
30
){
timeBaseCount
=
30
-
seconds
;
}
else
{
timeBaseCount
=
30
-
(
seconds
-
30
);
}
$
(
"
#tfa_j_otp_captcha_button
"
).
val
(
"
剩余时间(
"
+
timeBaseCount
+
"
)秒
"
);
};
var
currentSwitchTab
=
"
normalLogin
"
;
function
doLoginSubmit
(){
$
.
cookie
(
"
mxk_login_username
"
,
$
(
"
#
"
+
currentSwitchTab
+
"
Form input[name=username]
"
).
val
(),
{
expires
:
7
});
$
(
"
#
"
+
currentSwitchTab
+
"
SubmitButton
"
).
click
();
$
.
cookie
(
"
mxk_login_switch_tab
"
,
currentSwitchTab
,
{
expires
:
7
});
};
function
switchTab
(
id
){
if
(
$
(
"
#
"
+
id
+
"
Form input[name=username]
"
).
val
()
==
""
){
$
(
"
#
"
+
id
+
"
Form input[name=username]
"
).
focus
();
}
else
{
$
(
"
#
"
+
id
+
"
Form input[name=password]
"
).
focus
();
}
currentSwitchTab
=
id
;
}
document
.
onkeydown
=
function
(
event
){
var
e
=
event
||
window
.
event
||
arguments
.
callee
.
caller
.
arguments
[
0
];
if
(
e
&&
e
.
keyCode
==
13
){
doLoginSubmit
();
};
};
$
(
function
(){
//setInterval("currentTime()", 1000);
$
(
"
.doLoginSubmit
"
).
on
(
"
click
"
,
function
(){
doLoginSubmit
();
});
var
cookieLoginUsername
=
$
.
cookie
(
"
mxk_login_username
"
);
if
(
cookieLoginUsername
!=
undefined
&&
cookieLoginUsername
!=
""
){
var
switch_tab
=
$
.
cookie
(
"
mxk_login_switch_tab
"
)
==
undefined
?
"
normalLogin
"
:
$
.
cookie
(
"
mxk_login_switch_tab
"
);
$
(
"
#
"
+
switch_tab
).
click
();
$
(
"
#
"
+
switch_tab
+
"
Form input[name=username]
"
).
val
(
cookieLoginUsername
==
undefined
?
""
:
cookieLoginUsername
);
$
(
"
#div_
"
+
switch_tab
+
"
input[name=password]
"
).
focus
();
}
else
{
$
(
"
#div_normalLogin input[name=username]
"
).
focus
();
}
$
(
"
#mobile_j_otp_captcha_button
"
).
on
(
"
click
"
,
function
(){
if
(
captchaCount
<
60
){
return
;
}
var
loginName
=
$
(
"
#mobile_j_username
"
).
val
();
if
(
loginName
==
""
){
return
;
}
$
.
get
(
webContextPath
+
"
/login/sendsms/
"
+
loginName
,
function
(
data
,
status
){
//alert("Data: " + data + "\nStatus: " + status);
});
captchaCountTimer
=
setInterval
(
"
getCaptchaCount()
"
,
1000
);
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录