Merge pull request #1108 from wknet123/dev-optimize-sign-in

Updates for sign in form data check.
This commit is contained in:
kun wang 2016-11-17 14:26:05 +08:00 committed by GitHub
commit c221ce7b49

View File

@ -36,14 +36,17 @@
vm.doLogOut = doLogOut; vm.doLogOut = doLogOut;
vm.signInTIP = false; vm.signInTIP = false;
$scope.user = {};
function reset() { function reset() {
vm.hasError = false; vm.hasError = false;
vm.errorMessage = ''; vm.errorMessage = '';
} }
function doSignIn(user) { function doSignIn(user) {
if($scope.user.principal.length === 0 || $scope.user.password.length === 0) { if(!$scope.user.principal || !$scope.user.password ||
$scope.user.principal.length === 0 || $scope.user.password.length === 0) {
vm.hasError = true; vm.hasError = true;
vm.errorMessage = 'username_and_password_are_required'; vm.errorMessage = 'username_and_password_are_required';
} }