forked from knightliao/disconf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e91d31b
commit 04db7d1
Showing
19 changed files
with
271 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var appId = -1; | ||
var envId = -1; | ||
var version = ""; | ||
getSession(); | ||
|
||
// 提交 | ||
$("#item_submit").on("click", function (e) { | ||
$("#error").addClass("hide"); | ||
var old_password = $("#old_password").val(); | ||
var new_password = $("#new_password").val(); | ||
var new_password_2 = $("#new_password_2").val(); | ||
|
||
// 验证 | ||
if (!old_password || !new_password || !new_password_2) { | ||
$("#error").removeClass("hide"); | ||
$("#error").html("表单不能为空或填写格式错误!"); | ||
return; | ||
} | ||
$.ajax({ | ||
type: "PUT", | ||
url: "/api/account/password", | ||
data: { | ||
"old_password": old_password, | ||
"new_password": new_password, | ||
"new_password_2": new_password_2 | ||
} | ||
}).done(function (data) { | ||
$("#error").removeClass("hide"); | ||
if (data.success === "true") { | ||
$("#error").html(data.result); | ||
} else { | ||
Util.input.whiteError($("#error"), data); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<%= page.basehead %> | ||
|
||
<title>Disconf - 分布式配置管理平台</title> | ||
|
||
<%= page.head %> | ||
|
||
<div id="Wrapper" class="clearfix"> | ||
<div id="Main" style="margin-top:50px;"> | ||
<div class="container-fluid"> | ||
|
||
<div class="row-fluid"> | ||
<ul class="breadcrumb" style="background-color:#fff;"> | ||
<li> | ||
<a href="/main.html">配置</a> | ||
</li> | ||
<li class="active"> | ||
/ 修改密码 | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="row-fluid"> | ||
|
||
<div class="span12"> | ||
|
||
<div class="content oz"> | ||
|
||
<form id="form" class="private-form clearfix"> | ||
<h2 class="autoPush-detail-title">修改密码</h2> | ||
|
||
<div class="private-item"> | ||
<span class="private-item-key">原密码:</span> | ||
<input id="old_password" type="text" class="private-item-value"/> | ||
</div> | ||
|
||
<div class="private-item"> | ||
<span class="private-item-key">新密码:</span> | ||
<input id="new_password" type="password" class="private-item-value"/> | ||
</div> | ||
|
||
<div class="private-item"> | ||
<span class="private-item-key">新密码(重复):</span> | ||
<input id="new_password_2" type="password" class="private-item-value"/> | ||
</div> | ||
|
||
<div id="error" class="alert alert-warning hide" role="alert"> | ||
表单选项不能为空或填写格式错误! | ||
</div> | ||
<div class="private-item" style="text-align:center"> | ||
<a id="item_submit" class="btn btn-primary"> 修改 </a> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= page.foot %> | ||
|
||
<script src="assets/js/modify_password.js"></script> | ||
|
||
<%= page.basefoot %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
ALTER TABLE `config_history` | ||
ADD COLUMN `update_by` BIGINT(20) NULL DEFAULT NULL | ||
AFTER `create_time`; | ||
|
||
INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES | ||
(1,'/api/account/password' , '修改密码' , '0100'), | ||
(2,'/api/account/password' , '修改密码' , '0100'), | ||
(3,'/api/account/password' , '修改密码' , '0000'); |
36 changes: 36 additions & 0 deletions
36
disconf-web/src/main/java/com/baidu/disconf/web/service/user/form/PasswordModifyForm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.baidu.disconf.web.service.user.form; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
import org.hibernate.validator.constraints.NotEmpty; | ||
|
||
import com.baidu.dsp.common.form.RequestFormBase; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* @author liaoqiqi | ||
* @version 2014-1-24 | ||
*/ | ||
@Data | ||
public class PasswordModifyForm extends RequestFormBase { | ||
|
||
/** | ||
* | ||
*/ | ||
@NotNull(message = "password.empty") | ||
@NotEmpty(message = "password.empty") | ||
private String old_password; | ||
public static final String OLD_PASSWORD = "old_password"; | ||
|
||
@NotNull(message = "password.empty") | ||
@NotEmpty(message = "password.empty") | ||
private String new_password; | ||
public static final String NEW_PASSWORD = "new_password"; | ||
|
||
@NotNull(message = "password.empty") | ||
@NotEmpty(message = "password.empty") | ||
private String new_password_2; | ||
public static final String NEW_PASSWORD_2 = "new_password_2"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.