layui.use('layer', function(){ //独立版的layer无需执行这一句
var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
var f = {$server.f};
if(f==0){
layer.open({
id:1,
type: 1,
title:'修改密码',
skin:'layui-layer-rim',
area:['450px', 'auto'],
closeBtn :0,//右上角的关闭按钮取消
content: ' '
+''
+''
+' 新 密 码 :'
+''
+''
+''
+''
+''
+'确认密码:'
+''
+''
+''
+''
,
btn:['保存'],
btn1: function (index,layero) {
var firstpwd = $('#firstpwd').val();
var secondpwd = $('#secondpwd').val();
if(firstpwd != secondpwd){
layer.msg('密码不一致', {time: 1500, anim: 6});
}else{
$.post("{:url('index/edit')}", { firstpwd: firstpwd,'secondpwd':secondpwd},
function(data){
if(data.code==1){
layer.msg(data.msg, {time: 1500}, function () {
window.location.href = data.url;
});
}else{
layer.msg(data.msg, {time: 1500, anim: 6});
}
});
}
}
});
}
})