|
|
@@ -755,6 +755,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkFailed1 = false;
|
|
|
$scope.checkSuccess2 = false;
|
|
|
$scope.checkFailed2 = false;
|
|
|
+ window.location.href = "user#/accountManager/sec";
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -798,6 +799,10 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess = false;
|
|
|
});
|
|
|
};
|
|
|
+ //如果之前未绑定
|
|
|
+ if($scope.userInfo.userEmail==null?true:false){
|
|
|
+ $scope.checkSuccess = true;
|
|
|
+ }
|
|
|
|
|
|
//验证用户新输入的邮箱是否可用
|
|
|
$scope.checkSuccess1 = false;
|
|
|
@@ -882,15 +887,18 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
//修改邮箱地址
|
|
|
$scope.ok = function () {
|
|
|
- if ($scope.user.newUserEmail == $scope.user.userEmail) {
|
|
|
+ var param = {
|
|
|
+ newUserEmail: $scope.user.newUserEmail,
|
|
|
+ checkCode:$scope.checkCode
|
|
|
+ };
|
|
|
+ if ($scope.user.userEmail!=null && $scope.user.newUserEmail == $scope.user.userEmail) {
|
|
|
toaster.pop('error', '错误', '新邮箱地址与旧邮箱地址相同');
|
|
|
return;
|
|
|
+ }else{
|
|
|
+ param["userEmail"]=$scope.user.userEmail;
|
|
|
}
|
|
|
- User.updateUserEmail({
|
|
|
- userEmail: $scope.user.userEmail,
|
|
|
- newUserEmail: $scope.user.newUserEmail,
|
|
|
- checkCode:$scope.checkCode
|
|
|
- }, {}, function () {
|
|
|
+
|
|
|
+ User.updateUserEmail(param, {}, function () {
|
|
|
toaster.pop('success', '成功', '修改邮箱成功。');
|
|
|
//修改userInfo里面的userEmail
|
|
|
$scope.userInfo.userEmail =$scope.user.newUserEmail.substr(
|
|
|
@@ -906,6 +914,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess1 = false;
|
|
|
$scope.checkFailed1 = false;
|
|
|
$scope.sendSuccess = false;
|
|
|
+ window.location.href = "user#/accountManager/sec";
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -1052,6 +1061,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.emailSuccess = false;
|
|
|
$scope.codeSuccess = false;
|
|
|
$scope.validSuccess = false;
|
|
|
+ window.location.href = "user#/accountManager/sec";
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -1169,48 +1179,59 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
//校验原密码是否正确
|
|
|
$scope.checkUserPay = function (userPay) {
|
|
|
- if (userPay != null) {
|
|
|
+ if (userPay == null) {
|
|
|
+ $scope.checkFailed = true;
|
|
|
$scope.checkSuccess = false;
|
|
|
- $scope.checkFailed = false;
|
|
|
- User.checkUserPay({userPay: userPay}, function () {
|
|
|
- $scope.checkFailed = false;
|
|
|
- $scope.checkSuccess = true;
|
|
|
- }, function () {
|
|
|
- $scope.checkFailed = true;
|
|
|
- $scope.checkSuccess = false;
|
|
|
- });
|
|
|
+ return;
|
|
|
}
|
|
|
+ $scope.checkSuccess = false;
|
|
|
+ $scope.checkFailed = false;
|
|
|
+ User.checkUserPay({userPay: userPay}, function () {
|
|
|
+ $scope.checkFailed = false;
|
|
|
+ $scope.checkSuccess = true;
|
|
|
+ }, function () {
|
|
|
+ $scope.checkFailed = true;
|
|
|
+ $scope.checkSuccess = false;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//输入新密码,进行校验
|
|
|
$scope.checkSuccess1 = false;
|
|
|
$scope.checkFailed1 = false;
|
|
|
$scope.checkNewUserPay = function (newUserPay) {
|
|
|
- if (newUserPay != null) {
|
|
|
- //如果两者相同 则返回
|
|
|
- if ($scope.checking && ($scope.user.userPay
|
|
|
- == $scope.user.newUserPay)) {
|
|
|
- toaster.pop('error', '错误', '新密码与原密码相同');
|
|
|
- $scope.checkFailed1 = true;
|
|
|
- $scope.checkSuccess1 = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- //正则校验
|
|
|
- var reg = /^\d{6}$/;
|
|
|
- if (!reg.test(newUserPay)) {
|
|
|
- $scope.checkFailed1 = true;
|
|
|
- $scope.checkSuccess1 = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- $scope.checkFailed1 = false;
|
|
|
- $scope.checkSuccess1 = true;
|
|
|
+ if (newUserPay == null) {
|
|
|
+ $scope.checkFailed1 = true;
|
|
|
+ $scope.checkSuccess1 = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //如果两者相同 则返回
|
|
|
+ if ($scope.checking && ($scope.user.userPay
|
|
|
+ == $scope.user.newUserPay)) {
|
|
|
+ toaster.pop('error', '错误', '新密码与原密码相同');
|
|
|
+ $scope.checkFailed1 = true;
|
|
|
+ $scope.checkSuccess1 = false;
|
|
|
+ return;
|
|
|
}
|
|
|
+ //正则校验
|
|
|
+ var reg = /^\d{6}$/;
|
|
|
+ if (!reg.test(newUserPay)) {
|
|
|
+ $scope.checkFailed1 = true;
|
|
|
+ $scope.checkSuccess1 = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $scope.checkFailed1 = false;
|
|
|
+ $scope.checkSuccess1 = true;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//校验确认密码是否与新密码相同
|
|
|
$scope.checkSuccess2 = false;
|
|
|
$scope.checkFailed2 = false;
|
|
|
$scope.checkNewUserPay1 = function () {
|
|
|
+ if($scope.user.newUserPay1 == null){
|
|
|
+ $scope.checkSuccess2 = false;
|
|
|
+ $scope.checkFailed2 = true;
|
|
|
+ }
|
|
|
if ($scope.user.newUserPay1 != null) {
|
|
|
//如果输入密码正确,并且输入密码=重新输入密码
|
|
|
if ($scope.checkSuccess1 && ($scope.user.newUserPay
|
|
|
@@ -1245,6 +1266,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess2 = false;
|
|
|
$scope.checkFailed2 = false;
|
|
|
$scope.checking = true;
|
|
|
+ window.location.href = "user#/accountManager/sec";
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -1384,6 +1406,8 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkFailed3 = false;
|
|
|
$scope.checkFailed3_1 = false;
|
|
|
$scope.checkFailed1_1 = false;
|
|
|
+ window.location.href = "user#/accountManager/sec";
|
|
|
+ $modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
$modalInstance.close();
|
|
|
@@ -1482,7 +1506,8 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkFailed1 = false;
|
|
|
$scope.checkSuccess = false;
|
|
|
$scope.checkFailed = false;
|
|
|
- location.reload();
|
|
|
+ window.location.href = "user#/accountManager/sec";
|
|
|
+ $modalInstance.close();
|
|
|
}, function(response){
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
$modalInstance.close();
|