add tuban

This commit is contained in:
wlh
2014-12-26 17:02:29 +08:00
parent 420ba33883
commit cb150f6a38
119 changed files with 15281 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
app.controller('UcUserController',
['$http', '$cookieStore', '$scope', '$timeout', 'ServiceConfig',
function($http, $cookieStore, $scope, $timeout, ServiceConfig){
var user = $cookieStore.get('user');
if(!user){
return;
}
$scope.user = user;
$scope.changePassword = function(uc){
if(uc){
var old = uc.oldPassword;
var newP = uc.newPassword;
var reP = uc.rePassword;
if(newP !== reP || !newP || !reP || !old){
Tip.setTip(250, null, 150, null, 260, 80, '密码不一致或者没有输入密码', 1);
$timeout(Tip.hideTip, 3000);
}else{
var data = {
token: user.token,
oldPassword: old,
newPassword: newP,
rePassword: reP
};
$http.post(ServiceConfig.user_update_password, data).success(function(data){
if(data.status){
Tip.setTip(250, null, 150, null, 260, 80, '更改密码成功...', 1);
$timeout(Tip.hideTip, 3000);
}else{
Tip.setTip(250, null, 150, null, 260, 80, '更改密码失败...', 1);
$timeout(Tip.hideTip, 3000);
}
});
}
}else{
Tip.setTip(250, null, 150, null, 260, 80, '信息不能为空...', 1);
$timeout(Tip.hideTip, 3000);
}
};
}]);