2014-05-12 22:31:52 +08:00
|
|
|
var myModule = angular.module('landingPage', []);
|
|
|
|
|
2014-05-12 23:40:48 +08:00
|
|
|
|
2014-05-14 23:44:59 +08:00
|
|
|
myModule.controller('MainCtrl', function($scope, $http, $location, $window) {
|
2014-05-15 00:00:32 +08:00
|
|
|
$scope.postUsername = function() {
|
|
|
|
var account = {
|
|
|
|
"name": $scope.username,
|
2014-05-14 23:44:59 +08:00
|
|
|
"password": 'oOoOoO'
|
|
|
|
};
|
|
|
|
jQuery.getJSON("config.json", function (json) {
|
2014-05-15 00:00:32 +08:00
|
|
|
$http.post('/login', account).success(function(res) {
|
2014-05-15 03:28:45 +08:00
|
|
|
//alert(res.success.url);
|
2014-05-15 23:54:39 +08:00
|
|
|
$window.location.href = res.success.url;
|
2014-05-12 23:40:48 +08:00
|
|
|
});
|
2014-05-15 03:28:45 +08:00
|
|
|
});
|
2014-05-12 22:31:52 +08:00
|
|
|
}
|
2014-05-14 23:44:59 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|