修改密码
This commit is contained in:
1 parent
b9b5f93f29
commit
3927c22738
4 files changed
+49
-64
No files matched your search
@@ -317,9 +317,15 @@ class Index extends Base
|
||||
|
||||
|
||||
// 修改自己的密码
|
||||
public function editPassword($id)
|
||||
public function editPassword()
|
||||
{
|
||||
$list['id'] = $id;
|
||||
// 设置页面标题
|
||||
$list['set'] = array(
|
||||
'webtitle'=>'修改密码',
|
||||
'butname'=>'修改',
|
||||
'formpost'=>'PUT',
|
||||
'url'=>'/editpassword/'.session('userid'),
|
||||
);
|
||||
|
||||
// 模板赋值
|
||||
$this->assign('list',$list);
|
||||
@@ -335,7 +341,6 @@ class Index extends Base
|
||||
// 获取表单数据
|
||||
$list = request()->post();
|
||||
|
||||
|
||||
// 验证表单数据
|
||||
// 实例化验证模型
|
||||
$validate = new \app\admin\validate\SetPassword;
|
||||
|
||||
@@ -1,63 +1,43 @@
|
||||
{extend name="common@create" /}
|
||||
{block name="formaa"}
|
||||
<form action="/editpassword/{$list.id}" method="PUT" class="form form-horizontal" id="form-member-add">
|
||||
<table class="table table-border table-bordered table-bg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">修改密码</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="text-r" width="30%">旧密码:</th>
|
||||
<td><input name="oldpassword" id="oldpassword" class="input-text" type="password" autocomplete="off" placeholder="密码" tabindex="1" datatype="*6-16" nullmsg="请输入旧密码!" errormsg="4~16个字符,区分大小写!">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-r">新密码:</th>
|
||||
<td><input name="newpassword" id="newpassword" class="input-text" type="password" autocomplete="off" placeholder="设置密码" tabindex="2" datatype="*6-16" nullmsg="请输入您的新密码!" errormsg="4~16个字符,区分大小写!" >
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-r">再次输入新密码:</th>
|
||||
<td><input name="newpassword2" id="newpassword2" class="input-text" type="password" autocomplete="off" placeholder="确认新密码" tabindex="3" datatype="*" recheck="newpassword" nullmsg="请再输入一次新密码!" errormsg="您两次输入的新密码不一致!">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-success radius"><i class="icon-ok"></i> 确定</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
{block name="form"}
|
||||
<form class="layui-form layui-form-pane" lay-filter="myform">
|
||||
<div class="layui-form-item">
|
||||
<label for="oldpassword" class="layui-form-label">
|
||||
<span class="x-red">*</span>原密码
|
||||
</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="password" id="oldpassword" name="oldpassword" lay-verify="required"
|
||||
autocomplete="off" class="layui-input " value="" placeholder="原密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="newpassword" class="layui-form-label">
|
||||
<span class="x-red">*</span>新密码
|
||||
</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="password" id="newpassword" name="newpassword" lay-verify="required"
|
||||
autocomplete="off" class="layui-input " value="" placeholder="新密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="newpassword2" class="layui-form-label">
|
||||
<span class="x-red">*</span>再次输入密码
|
||||
</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="password" id="newpassword2" name="newpassword2" lay-verify="required"
|
||||
autocomplete="off" class="layui-input " value="" placeholder="再次输入密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="text-align: right;">
|
||||
<button class="layui-btn" lay-filter="mysubmit" lay-submit="">
|
||||
{$list.set.butname}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
{block name="yanzheng"}
|
||||
<script type="text/javascript">
|
||||
|
||||
// 密码帐号
|
||||
$.validator.addMethod("mm",function(value,element){
|
||||
var tel = /^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){6,20}$/;
|
||||
return this.optional(element) || tel.test(value);
|
||||
}, "只能输入6-16个字母、数字、下划线");
|
||||
|
||||
// 设置表单验证规则
|
||||
var myrules = {
|
||||
oldpassword:{
|
||||
required:true,
|
||||
},
|
||||
newpassword:{
|
||||
required:true,
|
||||
mm:true
|
||||
},
|
||||
newpassword2:{
|
||||
required:true,
|
||||
equalTo:"#newpassword"
|
||||
},
|
||||
};
|
||||
{block name="myjs"}
|
||||
|
||||
{/block}
|
||||
|
||||
// 设置表单提交方式
|
||||
var mytype = 'PUT';
|
||||
</script>
|
||||
{/block}
|
||||
@@ -44,7 +44,7 @@
|
||||
<a href="javascript:;">{$list.username}</a>
|
||||
<dl class="layui-nav-child"> <!-- 二级菜单 -->
|
||||
<dd><a onclick="x_admin_show('个人信息','/myinfo')">个人信息</a></dd>
|
||||
<!-- <dd><a onclick="x_admin_show('操作手册','https://www.kancloud.cn/llblax/abcd/789222')">操作手册</a></dd> -->
|
||||
<dd><a onclick="x_admin_show('修改密码','/editpassword/edit','400','300')">个人信息</a></dd>
|
||||
<dd><a href="/login">切换帐号</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
|
||||
Loaded 3 of 4 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user