Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
abf52034
Commit
abf52034
authored
Nov 06, 2018
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善修改密码页面
parent
ce5dc8a1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
88 deletions
+24
-88
src/main/java/cn/stylefeng/guns/modular/system/controller/UserMgrController.java
+5
-5
src/main/webapp/WEB-INF/common/_container.html
+3
-0
src/main/webapp/WEB-INF/system/user/user_chpwd.html
+2
-2
src/main/webapp/_static/js/common/ajax-object.js
+0
-67
src/main/webapp/assets/common/static/stylefeng/ajax-object.js
+2
-2
src/main/webapp/assets/common/static/stylefeng/feng.js
+3
-3
src/main/webapp/assets/modular/system/user/user_add.js
+2
-4
src/main/webapp/assets/modular/system/user/user_chpwd.js
+7
-5
No files found.
src/main/java/cn/stylefeng/guns/modular/system/controller/UserMgrController.java
View file @
abf52034
...
@@ -167,15 +167,15 @@ public class UserMgrController extends BaseController {
...
@@ -167,15 +167,15 @@ public class UserMgrController extends BaseController {
*/
*/
@RequestMapping
(
"/changePwd"
)
@RequestMapping
(
"/changePwd"
)
@ResponseBody
@ResponseBody
public
Object
changePwd
(
@RequestParam
String
oldPwd
,
@RequestParam
String
newPwd
,
@RequestParam
String
rePw
d
)
{
public
Object
changePwd
(
@RequestParam
(
"oldPassword"
)
String
oldPassword
,
@RequestParam
(
"newPassword"
)
String
newPasswor
d
)
{
if
(
!
newPwd
.
equals
(
rePw
d
))
{
if
(
ToolUtil
.
isOneEmpty
(
oldPassword
,
newPasswor
d
))
{
throw
new
ServiceException
(
BizExceptionEnum
.
TWO_PWD_NOT_MATCH
);
throw
new
RequestEmptyException
(
);
}
}
Integer
userId
=
ShiroKit
.
getUser
().
getId
();
Integer
userId
=
ShiroKit
.
getUser
().
getId
();
User
user
=
userService
.
selectById
(
userId
);
User
user
=
userService
.
selectById
(
userId
);
String
oldMd5
=
ShiroKit
.
md5
(
oldP
w
d
,
user
.
getSalt
());
String
oldMd5
=
ShiroKit
.
md5
(
oldP
asswor
d
,
user
.
getSalt
());
if
(
user
.
getPassword
().
equals
(
oldMd5
))
{
if
(
user
.
getPassword
().
equals
(
oldMd5
))
{
String
newMd5
=
ShiroKit
.
md5
(
newP
w
d
,
user
.
getSalt
());
String
newMd5
=
ShiroKit
.
md5
(
newP
asswor
d
,
user
.
getSalt
());
user
.
setPassword
(
newMd5
);
user
.
setPassword
(
newMd5
);
user
.
updateById
();
user
.
updateById
();
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
...
...
src/main/webapp/WEB-INF/common/_container.html
View file @
abf52034
...
@@ -128,6 +128,9 @@
...
@@ -128,6 +128,9 @@
<!--Custom JavaScript -->
<!--Custom JavaScript -->
<script
src=
"${ctxPath}/assets/common/static/js/custom.min.js"
></script>
<script
src=
"${ctxPath}/assets/common/static/js/custom.min.js"
></script>
<!-- vue -->
<script
src=
"${ctxPath}/assets/common/plugins/vue/vue.js"
></script>
<!-- 右侧主题设置 -->
<!-- 右侧主题设置 -->
<script
src=
"${ctxPath}/assets/common/plugins/styleswitcher/jQuery.style.switcher.js"
></script>
<script
src=
"${ctxPath}/assets/common/plugins/styleswitcher/jQuery.style.switcher.js"
></script>
...
...
src/main/webapp/WEB-INF/system/user/user_chpwd.html
View file @
abf52034
...
@@ -36,8 +36,8 @@
...
@@ -36,8 +36,8 @@
<button
class=
"btn btn-info"
type=
"button"
id=
"saveButton"
\@
click=
"ensure"
>
<button
class=
"btn btn-info"
type=
"button"
id=
"saveButton"
\@
click=
"ensure"
>
<i
class=
"ace-icon fa fa-check"
></i>
保存
<i
class=
"ace-icon fa fa-check"
></i>
保存
</button>
</button>
<button
class=
"btn btn-danger m-l-10"
type=
"button"
id=
"closeButton"
\@
clic=
"reset"
>
<button
class=
"btn btn-danger m-l-10"
type=
"button"
id=
"closeButton"
\@
clic
k
=
"reset"
>
<i
class=
"ace-icon fa fa-close"
></i>
关闭
<i
class=
"ace-icon fa fa-close"
></i>
重置
</button>
</button>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/_static/js/common/ajax-object.js
deleted
100644 → 0
View file @
ce5dc8a1
(
function
()
{
var
$ax
=
function
(
url
,
success
,
error
)
{
this
.
url
=
url
;
this
.
type
=
"post"
;
this
.
data
=
{};
this
.
dataType
=
"json"
;
this
.
async
=
false
;
this
.
success
=
success
;
this
.
error
=
error
;
};
$ax
.
prototype
=
{
start
:
function
()
{
var
me
=
this
;
if
(
this
.
url
.
indexOf
(
"?"
)
==
-
1
)
{
this
.
url
=
this
.
url
+
"?jstime="
+
new
Date
().
getTime
();
}
else
{
this
.
url
=
this
.
url
+
"&jstime="
+
new
Date
().
getTime
();
}
$
.
ajax
({
type
:
this
.
type
,
url
:
this
.
url
,
dataType
:
this
.
dataType
,
async
:
this
.
async
,
data
:
this
.
data
,
beforeSend
:
function
(
data
)
{
},
success
:
function
(
data
)
{
me
.
success
(
data
);
},
error
:
function
(
data
)
{
me
.
error
(
data
);
}
});
},
set
:
function
(
key
,
value
)
{
if
(
typeof
key
==
"object"
)
{
for
(
var
i
in
key
)
{
if
(
typeof
i
==
"function"
)
continue
;
this
.
data
[
i
]
=
key
[
i
];
}
}
else
{
this
.
data
[
key
]
=
(
typeof
value
==
"undefined"
)
?
$
(
"#"
+
key
).
val
()
:
value
;
}
return
this
;
},
setData
:
function
(
data
){
this
.
data
=
data
;
return
this
;
},
clear
:
function
()
{
this
.
data
=
{};
return
this
;
}
};
window
.
$ax
=
$ax
;
}
());
\ No newline at end of file
src/main/webapp/assets/common/static/stylefeng/ajax-object.js
View file @
abf52034
...
@@ -36,8 +36,8 @@
...
@@ -36,8 +36,8 @@
}
}
},
},
error
:
function
(
data
)
{
error
:
function
(
data
)
{
if
(
me
.
success
!==
undefined
)
{
if
(
me
.
error
!==
undefined
)
{
me
.
success
(
data
);
me
.
error
(
data
);
}
}
}
}
});
});
...
...
src/main/webapp/assets/common/static/stylefeng/feng.js
View file @
abf52034
...
@@ -36,7 +36,7 @@ var Feng = {
...
@@ -36,7 +36,7 @@ var Feng = {
position
:
'bottom-right'
,
position
:
'bottom-right'
,
loaderBg
:
'#ff6849'
,
loaderBg
:
'#ff6849'
,
icon
:
'info'
,
icon
:
'info'
,
hideAfter
:
2
000
,
hideAfter
:
3
000
,
stack
:
6
stack
:
6
});
});
},
},
...
@@ -47,7 +47,7 @@ var Feng = {
...
@@ -47,7 +47,7 @@ var Feng = {
position
:
'bottom-right'
,
position
:
'bottom-right'
,
loaderBg
:
'#ff6849'
,
loaderBg
:
'#ff6849'
,
icon
:
'success'
,
icon
:
'success'
,
hideAfter
:
2
000
,
hideAfter
:
3
000
,
stack
:
6
stack
:
6
});
});
},
},
...
@@ -58,7 +58,7 @@ var Feng = {
...
@@ -58,7 +58,7 @@ var Feng = {
position
:
'bottom-right'
,
position
:
'bottom-right'
,
loaderBg
:
'#ff6849'
,
loaderBg
:
'#ff6849'
,
icon
:
'error'
,
icon
:
'error'
,
hideAfter
:
2
000
,
hideAfter
:
3
000
,
stack
:
6
stack
:
6
});
});
},
},
...
...
src/main/webapp/assets/modular/system/user/user_add.js
View file @
abf52034
...
@@ -32,10 +32,6 @@ UserInfoDlg.validateForm = function () {
...
@@ -32,10 +32,6 @@ UserInfoDlg.validateForm = function () {
var
data
=
UserInfoDlg
.
data
;
var
data
=
UserInfoDlg
.
data
;
if
(
data
.
account
&&
data
.
password
&&
data
.
name
&&
data
.
deptid
)
{
return
true
;
}
if
(
!
data
.
account
)
{
if
(
!
data
.
account
)
{
return
"请输入账号"
;
return
"请输入账号"
;
}
}
...
@@ -48,6 +44,8 @@ UserInfoDlg.validateForm = function () {
...
@@ -48,6 +44,8 @@ UserInfoDlg.validateForm = function () {
if
(
!
data
.
deptid
)
{
if
(
!
data
.
deptid
)
{
return
"请选择部门"
;
return
"请选择部门"
;
}
}
return
true
;
};
};
/**
/**
...
...
src/main/webapp/assets/modular/system/user/user_chpwd.js
View file @
abf52034
...
@@ -25,10 +25,6 @@ UserPwdPage.validateForm = function () {
...
@@ -25,10 +25,6 @@ UserPwdPage.validateForm = function () {
var
data
=
UserPwdPage
.
data
;
var
data
=
UserPwdPage
.
data
;
if
(
data
.
oldPassword
&&
data
.
newPassword
&&
data
.
repeatPassword
)
{
return
true
;
}
if
(
!
data
.
oldPassword
)
{
if
(
!
data
.
oldPassword
)
{
return
"请输入旧密码"
;
return
"请输入旧密码"
;
}
}
...
@@ -39,6 +35,7 @@ UserPwdPage.validateForm = function () {
...
@@ -39,6 +35,7 @@ UserPwdPage.validateForm = function () {
return
"两次密码输入不一致"
;
return
"两次密码输入不一致"
;
}
}
return
true
;
};
};
/**
/**
...
@@ -61,7 +58,12 @@ $(function () {
...
@@ -61,7 +58,12 @@ $(function () {
data
:
UserPwdPage
.
data
,
data
:
UserPwdPage
.
data
,
methods
:
{
methods
:
{
ensure
:
function
()
{
ensure
:
function
()
{
UserPwdPage
.
chPwd
();
var
validateForm
=
UserPwdPage
.
validateForm
();
if
(
validateForm
===
true
)
{
UserPwdPage
.
chPwd
();
}
else
{
Feng
.
alert
(
validateForm
);
}
},
},
reset
:
function
()
{
reset
:
function
()
{
UserPwdPage
.
reset
();
UserPwdPage
.
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