Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
monitor-ui
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhengyouwei
9 years ago
Commit
ca349a6c8a7e8b247d4bd7d8bb89b9c6a5ceeacb
1 parent
580e4cf2
增加密码修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
monitor-ui-ctrl/src/main/java/com/ui/ctrl/ManagerCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/UserCtrl.java
monitor-ui-web/src/main/webapp/script/common/genarate_left_panel.js
monitor-ui-ctrl/src/main/java/com/ui/ctrl/ManagerCtrl.java
View file @
ca349a6
...
...
@@ -13,13 +13,11 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpSession
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -76,6 +74,9 @@ public class ManagerCtrl {
@RequestMapping
(
"/deleteUser"
)
@ResponseBody
public
BaseResponse
deleteUser
(
String
name
)
{
if
(
"admin"
.
equals
(
name
)){
return
new
BaseResponse
(
201
,
"此用户无法删除"
);
}
Map
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
name
);
BaseResponse
response
=
httpRestClient
.
defaultGet
(
HttpUriContants
.
USER_DELETE_NAME
,
BaseResponse
.
class
,
map
);
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/UserCtrl.java
View file @
ca349a6
...
...
@@ -34,6 +34,11 @@ public class UserCtrl {
return
new
ModelAndView
(
"user/login"
);
}
@RequestMapping
(
"/toupdatePwd"
)
public
ModelAndView
toupdatePwd
()
{
return
new
ModelAndView
(
"user/modifypwd"
);
}
@RequestMapping
(
"/login"
)
public
ModelAndView
toLogin
(
User
user
,
HttpSession
session
,
Model
model
)
{
User
u
=
userAuthLocal
.
getUserByname
(
user
.
getName
());
...
...
@@ -64,7 +69,7 @@ public class UserCtrl {
public
ModelAndView
updatePwd
(
String
name
,
String
oldpwd
,
String
newpwd
,
HttpSession
session
,
Model
model
)
{
Object
obj
=
session
.
getAttribute
(
"user"
);
String
username
=
String
.
valueOf
(
obj
);
if
(
"admin"
.
equals
(
username
))
{
if
(
"admin"
.
equals
(
username
)
&&
!
"admin"
.
equals
(
name
)
)
{
User
user
=
userAuthLocal
.
getUserByname
(
username
);
if
(
user
==
null
)
{
model
.
addAttribute
(
"message"
,
"当前用户不存在"
);
...
...
@@ -73,7 +78,7 @@ public class UserCtrl {
user
.
setPwd
(
MD5Util
.
encryption
(
newpwd
));
httpRestClient
.
defaultPost
(
HttpUriContants
.
USER_UPDATE_PWD
,
user
,
BaseResponse
.
class
);
userAuthLocal
.
flushUser
(
name
);
return
new
ModelAndView
(
"dashboard/
toDashb
oard"
);
return
new
ModelAndView
(
"dashboard/
dashB
oard"
);
}
else
if
(
name
.
equals
(
username
))
{
User
user
=
userAuthLocal
.
getUserByname
(
username
);
...
...
monitor-ui-web/src/main/webapp/script/common/genarate_left_panel.js
View file @
ca349a6
...
...
@@ -3,7 +3,7 @@
var
innerHTML
=
"<h5 style='color: #E0EEE0;font-style:oblique;font-weight:900;font-size:200%;margin-left: 45px;margin-top: 20px;'>YOHO</h5>"
;
innerHTML
+=
"<div id='user-nav'>"
;
innerHTML
+=
"<ul class='nav btn-group'>"
;
innerHTML
+=
"<li class='btn btn-inverse'><a
href='#'><i class='icon icon-cog'></i> <span class='text'>Settings
</span></a></li>"
;
innerHTML
+=
"<li class='btn btn-inverse'><a
id='changepwd_a' href='#'><i class='icon icon-cog'></i> <span class='text'>changePWD
</span></a></li>"
;
innerHTML
+=
"<li class='btn btn-inverse'><a id='logout_a' href='#'><i class='icon icon-share-alt'></i> <span class='text'>Logout</span></a></li>"
;
innerHTML
+=
"</ul>"
;
innerHTML
+=
"</div>"
;
...
...
@@ -49,6 +49,7 @@ document.getElementById("li_nginxview_a").setAttribute("href", path + "/nginx/to
document
.
getElementById
(
"li_projectRelease_a"
).
setAttribute
(
"href"
,
path
+
"/project/toProject"
);
document
.
getElementById
(
"li_others_a"
).
setAttribute
(
"href"
,
path
+
"/dashboard/toDashboard"
);
document
.
getElementById
(
"logout_a"
).
setAttribute
(
"href"
,
path
+
"/user/logout"
);
document
.
getElementById
(
"changepwd_a"
).
setAttribute
(
"href"
,
path
+
"/user/toupdatePwd"
);
document
.
getElementById
(
"li_others_a"
).
setAttribute
(
"href"
,
path
+
"/dashboard/toOthers"
);
document
.
getElementById
(
"li_zkMonitor_a"
).
setAttribute
(
"href"
,
path
+
"/zkTree/tozkMonitorList"
);
document
.
getElementById
(
"li_user_a"
).
setAttribute
(
"href"
,
path
+
"/manage/toUser"
);
...
...
Please
register
or
login
to post a comment