Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
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
platform
hg-smart
Commits
9086bb1f
Commit
9086bb1f
authored
Oct 31, 2024
by
江和松
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
3630525f
7f07fd39
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
655 additions
and
29 deletions
+655
-29
ByteUtils.java
src/main/java/com/baosight/hggp/util/ByteUtils.java
+179
-0
CommonMethod.java
src/main/java/com/baosight/hggp/util/CommonMethod.java
+18
-27
auto-login.js
src/main/resources/META-INF/resources/auto-login.js
+179
-0
auto-login.jsp
src/main/resources/META-INF/resources/auto-login.jsp
+242
-0
login.jsp
src/main/resources/META-INF/resources/login.jsp
+12
-2
applicationContext-security-trust-udp.xml
...pring/framework/applicationContext-security-trust-udp.xml
+25
-0
No files found.
src/main/java/com/baosight/hggp/util/ByteUtils.java
0 → 100644
View file @
9086bb1f
package
com
.
baosight
.
hggp
.
util
;
import
java.security.KeyFactory
;
import
java.security.MessageDigest
;
import
java.security.PrivateKey
;
import
java.security.Signature
;
import
java.security.spec.PKCS8EncodedKeySpec
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
/**
* @author songx
* @date 2024/10/31,15:15
*/
public
class
ByteUtils
{
private
static
final
String
DSA
=
"DSA"
;
private
static
SimpleDateFormat
CRED_TIME_FORMAT
=
new
SimpleDateFormat
(
"yyyyMMddHHmm"
);
private
static
String
CRED_SEPERATOR
=
":"
;
private
static
String
signatureAlg
=
"SHA1WithDSA"
;
private
static
String
SELF_PROJECTENAME
=
"A"
;
private
static
String
privateKeyStr
=
"3082014b0201003082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a041602145898ad70090def72e9d6a8ce864e688c366994a6"
;
private
static
String
publicKeyStr
=
"*****"
;
/**
* md5
*
* @param data String
* @return md5 md5
*/
public
static
final
String
MD5
(
String
data
)
{
try
{
MessageDigest
digest
=
MessageDigest
.
getInstance
(
"MD5"
);
digest
.
update
(
data
.
getBytes
(
"utf-8"
));
return
encodeHex
(
digest
.
digest
());
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
e
.
getMessage
());
}
}
/**
* bytesmd5
*
* @param bytes bytes
* @return the string
*/
public
static
final
String
encodeHex
(
byte
bytes
[])
{
StringBuffer
buf
=
new
StringBuffer
(
bytes
.
length
*
2
);
for
(
int
i
=
0
;
i
<
bytes
.
length
;
i
++)
{
if
((
bytes
[
i
]
&
0xff
)
<
16
)
{
buf
.
append
(
"0"
);
}
buf
.
append
(
Long
.
toString
(
bytes
[
i
]
&
0xff
,
16
));
}
return
buf
.
toString
();
}
/**
* byte
*
* @param hex
* @return byte[] byte
*/
public
static
final
byte
[]
decodeHex
(
String
hex
)
{
char
chars
[]
=
hex
.
toCharArray
();
byte
bytes
[]
=
new
byte
[
chars
.
length
/
2
];
int
byteCount
=
0
;
for
(
int
i
=
0
;
i
<
chars
.
length
;
i
+=
2
)
{
int
newByte
=
0
;
newByte
|=
hexCharToByte
(
chars
[
i
]);
newByte
<<=
4
;
newByte
|=
hexCharToByte
(
chars
[
i
+
1
]);
bytes
[
byteCount
]
=
(
byte
)
newByte
;
byteCount
++;
}
return
bytes
;
}
/**
*
*/
private
static
final
byte
hexCharToByte
(
char
ch
)
{
switch
(
ch
)
{
case
48
:
// '0'
return
0
;
case
49
:
// '1'
return
1
;
case
50
:
// '2'
return
2
;
case
51
:
// '3'
return
3
;
case
52
:
// '4'
return
4
;
case
53
:
// '5'
return
5
;
case
54
:
// '6'
return
6
;
case
55
:
// '7'
return
7
;
case
56
:
// '8'
return
8
;
case
57
:
// '9'
return
9
;
case
97
:
// 'a'
return
10
;
case
98
:
// 'b'
return
11
;
case
99
:
// 'c'
return
12
;
case
100
:
// 'd'
return
13
;
case
101
:
// 'e'
return
14
;
case
102
:
// 'f'
return
15
;
case
58
:
// ':'
case
59
:
// ';'
case
60
:
// '<'
case
61
:
// '='
case
62
:
// '>'
case
63
:
// '?'
case
64
:
// '@'
case
65
:
// 'A'
case
66
:
// 'B'
case
67
:
// 'C'
case
68
:
// 'D'
case
69
:
// 'E'
case
70
:
// 'F'
case
71
:
// 'G'
case
72
:
// 'H'
case
73
:
// 'I'
case
74
:
// 'J'
case
75
:
// 'K'
case
76
:
// 'L'
case
77
:
// 'M'
case
78
:
// 'N'
case
79
:
// 'O'
case
80
:
// 'P'
case
81
:
// 'Q'
case
82
:
// 'R'
case
83
:
// 'S'
case
84
:
// 'T'
case
85
:
// 'U'
case
86
:
// 'V'
case
87
:
// 'W'
case
88
:
// 'X'
case
89
:
// 'Y'
case
90
:
// 'Z'
case
91
:
// '['
case
92
:
// '\\'
case
93
:
// ']'
case
94
:
// '^'
case
95
:
// '_'
case
96
:
// '`'
default
:
return
0
;
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
KeyFactory
keyFactory
=
KeyFactory
.
getInstance
(
DSA
);
byte
pri
[]
=
ByteUtils
.
decodeHex
(
privateKeyStr
);
PKCS8EncodedKeySpec
privKeySpec
=
new
PKCS8EncodedKeySpec
(
pri
);
PrivateKey
priKey
=
keyFactory
.
generatePrivate
(
privKeySpec
);
Calendar
now
=
Calendar
.
getInstance
();
String
minuteStr
=
CRED_TIME_FORMAT
.
format
(
now
.
getTime
());
StringBuffer
str
=
new
StringBuffer
();
String
user
=
"YG5918"
;
str
.
append
(
minuteStr
).
append
(
CRED_SEPERATOR
).
append
(
user
).
append
(
CRED_SEPERATOR
).
append
(
"UDP"
).
append
(
CRED_SEPERATOR
).
append
(
"HGGP"
);
Signature
sig
=
Signature
.
getInstance
(
signatureAlg
);
sig
.
initSign
(
priKey
);
sig
.
update
(
str
.
toString
().
getBytes
(
"UTF8"
));
byte
[]
signature
=
sig
.
sign
();
String
signatureStr
=
ByteUtils
.
encodeHex
(
signature
);
str
.
append
(
CRED_SEPERATOR
).
append
(
signatureStr
);
System
.
out
.
println
(
str
);
}
}
src/main/java/com/baosight/hggp/util/CommonMethod.java
View file @
9086bb1f
...
...
@@ -89,33 +89,24 @@ public class CommonMethod {
tryValue
=
(
Map
)
result
;
}
catch
(
ClassCastException
e
){
tryValue
=
((
DaoEPBase
)
result
).
toMap
();
}
row
.
put
(
HGConstants
.
VALUE_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getValue
())));
if
(
isSplicingSymbol
)
{
row
.
put
(
HGConstants
.
TEXT_FIELD
,
(
tryValue
.
get
(
tableParam
.
getValue
())
+
HGConstants
.
SPLICING_SYMBOL
+
tryValue
.
get
(
tableParam
.
getText
())));
row
.
put
(
HGConstants
.
PARAM1_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam1
())));
row
.
put
(
HGConstants
.
PARAM2_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam2
())));
row
.
put
(
HGConstants
.
PARAM3_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam3
())));
row
.
put
(
HGConstants
.
PARAM4_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam4
())));
row
.
put
(
HGConstants
.
PARAM5_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam5
())));
row
.
put
(
HGConstants
.
PARAM6_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam6
())));
row
.
put
(
HGConstants
.
PARAM7_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam7
())));
row
.
put
(
HGConstants
.
PARAM8_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam8
())));
row
.
put
(
HGConstants
.
PARAM9_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam9
())));
row
.
put
(
HGConstants
.
PARAM10_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam10
())));
}
else
{
row
.
put
(
HGConstants
.
TEXT_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getText
())));
row
.
put
(
HGConstants
.
PARAM1_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam1
())));
row
.
put
(
HGConstants
.
PARAM2_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam2
())));
row
.
put
(
HGConstants
.
PARAM3_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam3
())));
row
.
put
(
HGConstants
.
PARAM4_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam4
())));
row
.
put
(
HGConstants
.
PARAM5_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam5
())));
row
.
put
(
HGConstants
.
PARAM6_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam6
())));
row
.
put
(
HGConstants
.
PARAM7_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam7
())));
row
.
put
(
HGConstants
.
PARAM8_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam8
())));
row
.
put
(
HGConstants
.
PARAM9_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam9
())));
row
.
put
(
HGConstants
.
PARAM10_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam10
())));
}
}
if
(
isSplicingSymbol
)
{
row
.
put
(
HGConstants
.
TEXT_FIELD
,
(
tryValue
.
get
(
tableParam
.
getValue
())
+
HGConstants
.
SPLICING_SYMBOL
+
tryValue
.
get
(
tableParam
.
getText
())));
}
else
{
row
.
put
(
HGConstants
.
TEXT_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getText
())));
}
row
.
put
(
HGConstants
.
VALUE_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getValue
())));
row
.
put
(
HGConstants
.
PARAM1_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam1
())));
row
.
put
(
HGConstants
.
PARAM2_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam2
())));
row
.
put
(
HGConstants
.
PARAM3_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam3
())));
row
.
put
(
HGConstants
.
PARAM4_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam4
())));
row
.
put
(
HGConstants
.
PARAM5_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam5
())));
row
.
put
(
HGConstants
.
PARAM6_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam6
())));
row
.
put
(
HGConstants
.
PARAM7_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam7
())));
row
.
put
(
HGConstants
.
PARAM8_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam8
())));
row
.
put
(
HGConstants
.
PARAM9_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam9
())));
row
.
put
(
HGConstants
.
PARAM10_FIELD
,
String
.
valueOf
(
tryValue
.
get
(
tableParam
.
getParam10
())));
resultRows
.
add
(
row
);
}
eiBlock
.
addBlockMeta
(
initCodeMeta
(
HGConstants
.
TEXT_FIELD
,
HGConstants
.
VALUE_FIELD
));
...
...
src/main/resources/META-INF/resources/auto-login.js
0 → 100644
View file @
9086bb1f
$
(
function
()
{
// 登录页加载完成时,进行浏览器版本检测
window
.
onload
=
function
()
{
var
BROWSER_VERSION
=
9
;
var
browser
=
(
function
()
{
var
ua
=
navigator
.
userAgent
,
tem
,
M
=
ua
.
match
(
/
(
opera|chrome|safari|firefox|msie|trident
(?=\/))\/?\s
*
(\d
+
)
/i
)
||
[];
if
(
/trident/i
.
test
(
M
[
1
]))
{
tem
=
/
\b
rv
[
:
]
+
(\d
+
)
/g
.
exec
(
ua
)
||
[];
return
'IE '
+
(
tem
[
1
]
||
''
);
}
if
(
M
[
1
]
===
'Chrome'
)
{
tem
=
ua
.
match
(
/
\b(
OPR|Edge
)\/(\d
+
)
/
);
if
(
tem
!=
null
)
return
tem
.
slice
(
1
).
join
(
' '
).
replace
(
'OPR'
,
'Opera'
);
}
M
=
M
[
2
]
?
[
M
[
1
],
M
[
2
]]
:
[
navigator
.
appName
,
navigator
.
appVersion
,
'-?'
];
if
((
tem
=
ua
.
match
(
/version
\/(\d
+
)
/i
))
!=
null
)
M
.
splice
(
1
,
1
,
tem
[
1
]);
return
M
.
join
(
' '
);
})();
var
BrowserVersion
=
browser
.
split
(
" "
);
if
((
/^
(
MS
)?(
)?
IE/
).
test
(
browser
)
&&
BrowserVersion
[
1
]
<
BROWSER_VERSION
)
{
$
(
".warning-window"
).
css
(
"display"
,
"block"
);
$
(
".i-overlay"
).
css
(
"display"
,
"block"
);
}
if
((
/^
(
MS
)?(
)?
IE/
).
test
(
browser
)
&&
BrowserVersion
[
1
]
<
BROWSER_VERSION
-
1
)
{
$
(
"#login"
).
attr
(
"disabled"
,
true
);
}
// 触发登录操作
loginClick
();
};
$
(
".i-close"
).
on
(
"click"
,
function
()
{
$
(
".warning-window"
).
css
(
"display"
,
"none"
);
$
(
".i-overlay"
).
css
(
"display"
,
"none"
);
});
//放大镜
$
(
".i-zoom-close"
).
on
(
"click"
,
function
()
{
$
(
".zoom-window"
).
css
(
"display"
,
"none"
);
$
(
".i-overlay"
).
css
(
"display"
,
"none"
);
});
$
(
".info-detail"
).
on
(
"click"
,
function
()
{
$
(
".zoom-window"
).
css
(
"display"
,
"block"
);
$
(
".i-overlay"
).
css
(
"display"
,
"block"
);
});
$
.
fn
.
textScroll
=
function
(
options
)
{
var
defaults
=
{
duration
:
8000
,
//滚动总时长控制
mode
:
'normal'
,
//滚动模式:普通normal;逐行line
perDistance
:
18
//line模式下每次滚动距离
},
that
=
this
,
scrollInterval
,
content
=
this
.
find
(
".text-content"
);
var
items
=
$
.
extend
({},
defaults
,
options
);
//添加占位元素,处理无法滚动到底的情况
function
addHoldDiv
(
stage
,
textContent
)
{
if
(
items
.
mode
===
'no-gap'
)
{
that
.
append
(
content
.
clone
().
addClass
(
"second-text"
));
}
else
{
var
holdDiv
=
"<div class='hold-scroll'></div>"
;
stage
.
append
(
holdDiv
);
var
divHeight
=
stage
.
height
()
+
textContent
.
height
();
$
(
".hold-scroll"
).
css
({
"width"
:
"100%"
,
"height"
:
divHeight
,
"color"
:
"transparent"
});
}
}
//根据不同模式添加动画
function
addAnimate
()
{
if
(
items
.
mode
===
'normal'
||
items
.
mode
===
'no-gap'
)
{
var
scrollPercent
=
that
.
scrollTop
()
/
content
.
outerHeight
(
true
);
if
(
that
.
scrollTop
()
===
0
)
{
that
.
animate
({
scrollTop
:
'0'
},
1000
);
}
that
.
animate
({
scrollTop
:
content
.
outerHeight
(
true
)},
Math
.
round
(
items
.
duration
*
(
1
-
scrollPercent
)),
"linear"
);
that
.
animate
({
scrollTop
:
'0'
},
0
,
arguments
.
callee
);
}
else
if
(
items
.
mode
===
'line'
)
{
var
times
=
Math
.
ceil
(
content
.
outerHeight
(
true
)
/
items
.
perDistance
);
scrollInterval
=
setInterval
(
function
()
{
if
(
content
.
outerHeight
(
true
)
-
that
.
scrollTop
()
<=
0
)
{
that
.
animate
({
scrollTop
:
0
},
0
);
}
else
{
that
.
animate
({
scrollTop
:
that
.
scrollTop
()
+
items
.
perDistance
},
0
);
}
},
Math
.
round
(
items
.
duration
/
times
));
}
}
addHoldDiv
(
that
,
content
);
that
.
niceScroll
({
'autohidemode'
:
'false'
});
that
.
mouseenter
(
function
()
{
if
(
items
.
mode
===
'normal'
||
items
.
mode
===
'no-gap'
)
{
that
.
stop
(
true
);
}
else
if
(
items
.
mode
===
'line'
)
{
clearInterval
(
scrollInterval
);
}
that
.
getNiceScroll
().
show
();
});
that
.
mouseleave
(
function
(
e
)
{
var
targetElement
=
$
(
e
.
toElement
);
if
(
targetElement
.
hasClass
(
"nicescroll-rails-vr"
)
||
targetElement
.
hasClass
(
"nicescroll-cursors"
))
{
targetElement
.
one
(
"mouseleave"
,
function
(
e
)
{
if
(
$
(
e
.
toElement
)
!==
that
&&
!
$
(
e
.
toElement
).
hasClass
(
"nicescroll-rails-vr"
))
{
that
.
getNiceScroll
().
hide
();
addAnimate
();
}
});
}
else
if
(
!
targetElement
.
hasClass
(
"nicescroll-rails-vr"
)
&&
!
targetElement
.
hasClass
(
"nicescroll-cursors"
))
{
that
.
getNiceScroll
().
hide
();
addAnimate
();
}
});
that
.
mouseleave
();
};
loginClick
=
function
()
{
var
loginForm
=
document
.
getElementsByTagName
(
"form"
)[
0
];
var
urlParam
=
location
.
href
.
substr
(
location
.
href
.
indexOf
(
"?"
)
+
1
);
if
(
urlParam
.
indexOf
(
"p_redirect"
)
!==
-
1
)
{
var
keyString
=
urlParam
.
split
(
'='
)[
0
];
var
valueString
=
urlParam
.
split
(
'='
)[
1
];
if
(
keyString
===
"p_redirect"
)
{
var
tmpInput
=
document
.
createElement
(
"input"
);
tmpInput
.
type
=
"hidden"
;
tmpInput
.
name
=
"p_redirect"
;
tmpInput
.
value
=
valueString
;
loginForm
.
appendChild
(
tmpInput
);
}
}
// 将密码框的值修改为加密后的值
var
loginPublicKey
=
$
(
"#__LOGIN_PUBLICKEY__"
).
val
();
if
(
isAvailable
(
loginPublicKey
)){
var
encrypt
=
new
JSEncrypt
();
encrypt
.
setPublicKey
(
loginPublicKey
);
var
encryptedUsername
=
encrypt
.
encrypt
(
$
(
"input[name='p_username1']"
).
val
());
$
(
"input[name='p_username']"
).
val
(
encryptedUsername
);
var
encryptedPassword
=
encrypt
.
encrypt
(
$
(
"input[name='p_password1']"
).
val
());
$
(
"input[name='p_password']"
).
val
(
encryptedPassword
);
}
loginForm
.
submit
();
};
//判断是否值能获取的方法
function
isAvailable
(
obj
)
{
if
(
obj
===
undefined
)
{
return
false
;
}
if
(
obj
===
null
)
{
return
false
;
}
if
(
obj
===
"null"
)
{
return
false
;
}
return
obj
!==
""
;
}
function
getParameterByName
(
name
,
url
)
{
var
regex
=
new
RegExp
(
"[?&]"
+
name
+
"(=([^&#]*)|&|#|$)"
),
results
=
regex
.
exec
(
url
);
if
(
!
results
)
{
return
null
;
}
if
(
!
results
[
2
])
{
return
null
;
}
return
decodeURIComponent
(
results
[
2
].
replace
(
/
\+
/g
,
" "
));
}
});
src/main/resources/META-INF/resources/auto-login.jsp
0 → 100644
View file @
9086bb1f
<!DOCTYPE html>
<
%@
page
contentType=
"text/html; charset=UTF-8"
%
>
<
%@
page
import=
"com.baosight.iplat4j.common.constant.RSAConstants"
%
>
<
%@
page
import=
"com.baosight.iplat4j.core.FrameworkInfo"
%
>
<
%@
page
import=
"com.baosight.iplat4j.core.license.LicenseStub"
%
>
<
%@
page
import=
"com.baosight.iplat4j.core.log.Logger"
%
>
<
%@
page
import=
"com.baosight.iplat4j.core.log.LoggerFactory"
%
>
<
%@
page
import=
"com.baosight.iplat4j.core.util.StringUtils"
%
>
<
%@
page
import=
"java.net.URLDecoder"
%
>
<
%@
taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%
>
<
%@
taglib
prefix=
"EF"
tagdir=
"/WEB-INF/tags/EF"
%
>
<
%
org
.
springframework
.
security
.
core
.
context
.
SecurityContextHolder
.
clearContext
();
LicenseStub
.
setLicenseDir
(
application
.
getRealPath
("/
WEB-INF
"));
String
[]
ret =
LicenseStub.checkLicense2();
boolean
valid =
"true"
.
equals
(
ret
[
0
]);
//
LicenseStub
.
checkLicense2
();
int
days =
0;
if
(!"".
equals
(
ret
[
2
])
&&
!"
0
".
equals
(
ret
[
2
]))
{
days =
Integer.parseInt(ret[2]);
}
String
licMsg =
valid
?
(("
false
".
equals
(
ret
[
3
])
&&
days
>
= -10
&&
days
<
0
)
?
"<
div
style=
'color:#ee9933;font-weight:bold;font-size:18px'
>
许可证还有[" + (-days) + "]天将过期!
</div>
"
: "")
: "
<div
style=
'color:red;font-weight:bold;font-size:22px'
>
许可证非法!
</div>
";
Exception exp = (Exception) request.getAttribute("AuthenticationException");
String user = (String) request.getAttribute("AuthenticationUser");
if (!org.springframework.util.StringUtils.isEmpty(request.getParameter("expmsg"))) {
String expmsg = request.getParameter("expmsg");
exp = new Exception(URLDecoder.decode("Exception:" + expmsg));
}
String loginErrTag = "0";
if (!org.springframework.util.StringUtils.isEmpty(request.getParameter("login_error"))) {
loginErrTag = request.getParameter("login_error");
}
String username = "";
String password = "";
String captcha = "";
if (exp != null) {
username = user;
}
String usrHeader = request.getHeader("user-agent");
String projectCname = FrameworkInfo.getProjectCname();
String projectTypeDesc = FrameworkInfo.getProjectTypeDesc();
// 获取iPlatUI静态资源地址
String iPlatStaticURL = FrameworkInfo.getPlatStaticURL(request);
String theme = "ant";
// 获取Context根路径,考虑到分布式部署的场景,不能直接使用WebContext
String iPlatContext = FrameworkInfo.getPlatWebContext(request);
//读取加密配置,以及公钥
String loginPublicKey = "";
if ("on".equals(RSAConstants.cryptoPasswordEnable)) {
loginPublicKey = RSAConstants.loginRsaPublicKey;
}
final Logger logger = LoggerFactory.getLogger("index");
String LoginLogo = "default";
String LoginSystemName = "";
%>
<c:set
var=
"ctx"
value=
"<%=iPlatContext%>"
/>
<c:set
var=
"iPlatStaticURL"
value=
"<%=iPlatStaticURL%>"
/>
<c:set
var=
"loginExp"
value=
"<%=exp%>"
/>
<c:set
var=
"theme"
value=
"<%=theme%>"
scope=
"session"
/>
<c:set
var=
"LoginLogo"
value=
"<%=LoginLogo%>"
/>
<c:set
var=
"LoginSystemName"
value=
"<%=LoginLogo%>"
/>
<html
class=
"i-theme-blue"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
name=
"robots"
content=
"noindex, nofollow"
/>
<meta
name=
"description"
content=
"登录界面"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
/>
<
%
if
(
StringUtils
.
isNotEmpty
(
projectCname
)
&&
StringUtils
.
isNotEmpty
(
projectTypeDesc
))
{
%
>
<title><
%=
projectCname
%
>
[
<
%=
projectTypeDesc
%
>
]登录界面
</title>
<
%
}
else
{
%
>
<title>
登录界面
</title>
<
%
}
%
>
<link
rel=
"shortcut icon"
href=
"iplat.ico"
type=
"image/x-icon"
>
<link
rel=
"stylesheet"
id=
"css-main"
href=
"${iPlatStaticURL}/iplatui/assets/css/iplat.ui.bootstrap.min.css"
>
<link
href=
"${iPlatStaticURL}/iPlatV7-login.css"
rel=
"stylesheet"
type=
"text/css"
/>
<
%
--
<
link
rel=
"stylesheet"
type=
"text/css"
href=
"${iPlatStaticURL}/iplatui/css/iplat.ui.ued.login.css"
>
<
%
–
ued亮色样式
–
%
>
--%>
<script
src=
"${iPlatStaticURL}/kendoui/js/jquery.min.js"
></script>
<!--[if lte IE 8]>
<link href="${iPlatStaticURL}/iPlatV7-login-ie.css" rel="stylesheet" type="text/css"/>
<script src="${iPlatStaticURL}/iplatui/assets/js/polyfills/iplat.ui.ie8.polyfills.min.js"></script>
<![endif]-->
<script
src=
"${iPlatStaticURL}/auto-login.js"
></script>
<
%
--
引入
RSA
加密
js--
%
>
<script
src=
"${iPlatStaticURL}/iplatui/js/jsencrypt.js"
></script>
<
%
String
domain =
FrameworkInfo.getProjectAppTopDomain();
if
(
domain
!=
null
&&
domain
.
startsWith
("."))
{
domain =
domain.substring(1);
%
>
<script
type=
"text/javascript"
>
try
{
document
.
domain
=
'<%=domain%>'
;
}
catch
(
ex
)
{
alert
(
'model not valid[<%=domain%>]'
);
}
</script>
<
%
}
%
>
</head>
<body
class=
"i-theme-${theme}"
style=
"display: none;"
>
<div
class=
"main"
>
<div
class=
"wrapper"
>
<div
class=
"content overflow-hidden"
>
<div
class=
"row"
>
<
%
--
公钥参数
--
%
>
<input
id=
"__LOGIN_PUBLICKEY__"
inline=
"true"
type=
"hidden"
value=
"<%=loginPublicKey%>"
/>
<div
class=
"col-sm-6 col-sm-offset-2 col-md-4 col-md-offset-4"
style=
"margin-bottom: 1em"
>
<div
class=
"form-header"
>
<p
style=
"font-size: 28px;"
><b>
企业经营一体化平台
</b></p>
</div>
</div>
<div
class=
"col-sm-6 col-sm-offset-2 col-md-4 col-md-offset-4"
>
<div
class=
"login-block <c:if test="
${
not
empty
loginExp
}"
>
animated shake
</c:if>
"
style="background-color: white;border-radius: 10px">
<div
class=
"form-header"
>
<c:choose>
<c:when
test=
"${LoginLogo == 'default'}"
>
<div
class=
""
>
<
%
--logodefault--
%
>
<div
style=
"color: #004B9D;margin-left: 63%"
><
%=
LoginSystemName
%
>
</div>
</div>
</c:when>
<c:otherwise>
<div
class=
"logo"
>
<img
src=
"<%=LoginLogo%>"
style=
"float: left;height: 43px"
>
<div
style=
" width: 2px;height: 43px;background-color: rgba(28, 29, 35, 0.04);float: left;margin-left: 10px;margin-right: 10px"
></div>
<img
src=
"iplatui/img/login/bld_logo.png"
style=
"float: left;width: 90px;height: 43px;"
>
<div
style=
"color: #004B9D;margin-left: 58%"
><
%=
LoginSystemName
%
>
</div>
</div>
</c:otherwise>
</c:choose>
<p
style=
"font-size: 20px;color: black;"
>
用户登录
</p>
<p
class=
"text-danger"
>
<c:if
test=
"${not empty loginExp}"
>
<
%
String
loginError =
exp.getMessage();
int
index =
loginError.indexOf("Exception:");
if
(
index
>
= 0) {
loginError = loginError.substring(index + 10);
}
if (!"1".equals(loginErrTag)
&&
(request.getAttribute("AuthenticationUser") == null
|| request.getAttribute("AuthenticationUser") == "")) {
loginError = "请输入用户名";
}
%>
<
%=
loginError
%
>
</c:if>
</p>
</div>
<form
autocomplete=
"off"
class=
"form-horizontal push-10-t push-10"
action=
"${ctx}/login"
method=
"post"
onsubmit=
"javascript:return loginClick();"
>
<div
class=
"form-group"
>
<div
class=
"col-xs-12"
>
<div
class=
"input-group"
>
<div
class=
"input-group-addon"
style=
"background-color: rgb(232, 240, 254)"
>
账号
</div>
<input
class=
"form-input"
type=
"text"
style=
"border: rgb(232, 240, 254);background-color: rgb(232, 240, 254);color: black"
value=
"YG5918"
name=
"p_username1"
placeholder=
"用户名"
/>
</div>
</div>
</div>
<div
class=
"form-group password"
>
<div
class=
"col-xs-12"
>
<div
class=
"input-group"
>
<div
class=
"input-group-addon"
style=
"background-color: rgb(232, 240, 254)"
>
密码
</div>
<input
class=
"form-input"
type=
"password"
style=
"border: rgb(232, 240, 254);background-color: rgb(232, 240, 254);color: black"
value=
"Easy160731!"
name=
"p_password1"
autocomplete=
"off"
placeholder=
"密码"
/>
</div>
</div>
</div>
<input
type=
"text"
name=
"p_username"
placeholder=
"用户名"
style=
""
/>
<input
type=
"password"
name=
"p_password"
autocomplete=
"off"
placeholder=
"密码"
style=
""
/>
<div
class=
"form-group remember"
>
<div
class=
"col-xs-6"
>
<
%
--
<
label
class=
"css-input"
>
--%>
<
%
--
<
input
type=
"checkbox"
id=
"login-remember-me"
value=
"false"
--
%
>
<
%
--name=
"remember-me"
/><span
class=
"i-icon"
></span>
--%>
<
%
--2
周内免登录
--
%
>
<
%
--
</
label
>
--%>
<
%
--
<
a
href=
"${ctx}/web/XS0102"
>
注册账号
</a>
--%>
</div>
<div
class=
"col-xs-6"
style=
"text-align: right"
>
<
%
--
<
a
href=
"${ctx}/web/XS0102"
style=
"margin-right: 6px"
>
注册
</a>
--%>
<
%
--
<
a
href=
"${ctx}/web/XS0106"
>
忘记密码?
</a>
--%>
</div>
</div>
<div
class=
"form-group log-in"
>
<div
class=
"col-xs-12"
>
<button
id=
"login"
class=
"login-btn"
type=
"submit"
>
登录
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"i-overlay"
></div>
</body>
<script
type=
"text/javascript"
>
var
ctx
=
"${ctx}"
;
</script>
</html>
src/main/resources/META-INF/resources/login.jsp
View file @
9086bb1f
...
...
@@ -21,6 +21,7 @@
%>
<%
String pAuthen = request.getParameter("p_authen");
String directmode = request.getParameter("maintain") != null ? request.getParameter("maintain").toString() : "";
RequestDispatcher rd;
String appName = FrameworkInfo.getProjectAppName();
...
...
@@ -94,8 +95,17 @@
} else {
response.sendRedirect(request.getContextPath() + _urlHtml);
}
} else if ("Trust".equals(pAuthen)) {
// 自动登录
rd = request.getRequestDispatcher("auto-login.jsp");
try {
rd.forward(request, response);
} catch (ServletException e1) {
e1.printStackTrace();
} finally {
out.clear();
out = pageContext.pushBody();
}
} else {
//以正常方式进入登录首页
rd = request.getRequestDispatcher("iPlatV7-login.jsp");
...
...
src/main/resources/spring/framework/applicationContext-security-trust-udp.xml
0 → 100644
View file @
9086bb1f
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns:sec=
"http://www.springframework.org/schema/security"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://www.springframework.org/schema/beans"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.2.xsd"
>
<bean
id=
"keyPairLocator"
class=
"com.baosight.xservices.xs.sso.SecretKeyPairLocator4Config"
>
<property
name=
"keyPairMapping"
>
<map>
<entry
key=
"UDP"
>
<bean
class=
"com.baosight.xservices.xs.sso.SecretKeyPair4DSA"
>
<property
name=
"private"
value=
"3082014b0201003082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a041602145898ad70090def72e9d6a8ce864e688c366994a6"
/>
<property
name=
"public"
value=
"308201b73082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a0381840002818009202eda89c00359a104d5ffbd043f515c737588bac7be945d89c995b9c50f43b08881f3b93592d31ec4e55a905c30e1f4fdb39a4241697a526ebedfd6fc5238d3fb0ac793af0183a4716182aaa8cb2b325f2f8d4d298f115a430866e0c99e5386a1309853e43d17fc2bdc39a4ba64c714f33c2e7049d22440c947479f9c3f6c"
/>
</bean>
</entry>
</map>
</property>
</bean>
</beans>
\ No newline at end of file
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