Blame view
app/views/login/login.controller.js
1.06 KB
5c6477d3d
|
1 2 3 4 |
'use strict'; //Load controller angular.module('inspinia') |
22d319238
|
5 |
.controller('LoginController', function ($scope, $state, LoginService) { |
5c6477d3d
|
6 7 8 9 |
$scope.user = {}; $scope.userData = function(){ |
0a4eb77cc
|
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
var loginData = "username=" + $scope.user.username + "&password=" + $scope.user.password; LoginService.loginUser(loginData).then(function(result) { console.log(result) //$state.go('index.dashboard'); if(typeof result == 'object') { LoginService.authenticate(); LoginService.setAuth(true); $rootScope.path = true; // var reqPwdChng = localStorage.getItem("requiredChangePwd"); // if (reqPwdChng && reqPwdChng == "Y") { // $state.go('resetPassword'); // } else { // $state.go('app.upload'); // } } else { //toastr.info("Error in login. Please check login name and password"); } }) |
5c6477d3d
|
29 30 31 |
} }); |