personal.js
1.72 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var prefix = "/sys/user"
$(function () {
laydate({
elem : '#birth'
});
});
/**
* 基本信息提交
*/
$("#base_save").click(function () {
var hobbyStr = getHobbyStr();
$("#hobby").val(hobbyStr);
if($("#basicInfoForm").valid()){
$.ajax({
cache : true,
type : "POST",
url :"/sys/user/updatePeronal",
data : $('#basicInfoForm').serialize(),
async : false,
error : function(request) {
laryer.alert("Connection error");
},
success : function(data) {
if (data.code == 0) {
parent.layer.msg("更新成功");
} else {
parent.layer.alert(data.msg)
}
}
});
}
});
$("#pwd_save").click(function () {
if($("#modifyPwd").valid()){
$.ajax({
cache : true,
type : "POST",
url :"/sys/user/resetPwd",
data : $('#modifyPwd').serialize(),
async : false,
error : function(request) {
parent.laryer.alert("Connection error");
},
success : function(data) {
if (data.code == 0) {
parent.layer.alert("更新密码成功");
$("#photo_info").click();
} else {
parent.layer.alert(data.msg)
}
}
});
}
});
function getHobbyStr(){
var hobbyStr ="";
$(".hobby").each(function () {
if($(this).is(":checked")){
hobbyStr+=$(this).val()+";";
}
});
return hobbyStr;
}