@{
|
ViewBag.Title = "UpdatePassword";
|
Layout = "~/Views/Shared/_LayoutVue.cshtml";
|
}
|
<div id="updatePassword" v-cloak>
|
<el-form label-width="135px" v-bind:rules="formRules" v-bind:model="formData" class="demo-ruleForm" v-bind:inline="true" ref="formData">
|
<el-form-item label="当前密码:" prop="currentPwd">
|
<el-input type="password" autocomplete="off" v-model="formData.currentPwd" size="mini"></el-input>
|
</el-form-item><el-form-item label="新密码:" prop="newPwd">
|
<el-input type="password" autocomplete="off" v-model="formData.newPwd" size="mini"></el-input>
|
</el-form-item><el-form-item label="确认新密码:" prop="secondPwd">
|
<el-input type="password" autocomplete="off" v-model="formData.secondPwd" size="mini"></el-input>
|
</el-form-item>
|
</el-form>
|
<el-footer style="text-align:center;padding:20px 20px 20px">
|
<el-row>
|
<el-button v-on:click="close" size="mini">取消</el-button>
|
<el-button type="primary" v-on:click="save" size="mini">确定</el-button>
|
</el-row>
|
</el-footer>
|
</div>
|
@section scripts{
|
<script>
|
new Vue({
|
el: '#updatePassword',
|
data: {
|
formData: {
|
currentPwd: "",
|
newPwd: "",
|
secondPwd: ""
|
},
|
formRules: {
|
currentPwd: [
|
{ required: true, message: ' ', trigger: 'blur' }
|
],
|
newPwd: [
|
{ required: true, message: ' ', trigger: 'blur' }
|
],
|
secondPwd: [
|
{ required: true, message: ' ', trigger: 'blur' }
|
]
|
},
|
},
|
methods: {
|
save: function () {
|
var $this = this;
|
this.$refs["formData"].validate(function (valid) {
|
if (valid) {
|
if ($this.formData.newPwd != $this.formData.secondPwd) {
|
wms.warning("两次输入不一致!");
|
return;
|
}
|
ajaxManage({
|
url: "@Url.Action("UpdatePassword")",
|
data: $this.formData,
|
success: function (data) {
|
if (!data) {
|
wms.error("系统异常");
|
return;
|
}
|
if (data.Success) {
|
$this.close();
|
$.ajax({
|
type: 'GET',
|
async: false,
|
data: { endType: "hand" },
|
url: '../Home/Exit',
|
success: function (data) {
|
location.href = '/Login';
|
}
|
});
|
}
|
else {
|
wms.error(data.Msg);
|
}
|
}
|
});
|
} else {
|
wms.warning("验证不通过!");
|
}
|
});
|
},
|
close: function () {
|
wms.dialogFrame.show = false;
|
}
|
}
|
|
});
|
</script>
|
}
|