show_person.js
978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$(function() {
// 头像展示
$('[name="model.title_url"]').change(function(){
var pic = $(this).val() ;
if(pic == '') {
pic = jflyfox.BASE_PATH + 'static/images/user/user.png';
}
$('#title_pic').attr('src',pic);
});
});
function oper_save(){
if($('[name="old_password"]').val()==''){
alert('密码不能为空');
return;
}
jQuery.ajax({
type:'POST',
url:jflyfox.BASE_PATH + 'front/person/save',
data:$("form").serialize(),
success:function(data){
if(data.status==1){
alert('保存成功');
} else {
alert('保存失败:'+data.msg);
}
$('[name="old_password"]').val('');
$('[name="new_password"]').val('');
$('[name="new_password2"]').val('');
},
error:function(html){
var flag = (typeof console != 'undefined');
if(flag) console.log("服务器忙,提交数据失败,代码:" +html.status+ ",请联系管理员!");
alert("服务器忙,提交数据失败,请联系管理员!");
}
});
}