var loginObj = angular.module('myApp', []); loginObj.controller('myCtrl', function($scope, $http) { // 用户登陆 $scope.userLogin = function () { console.log($scope.username, $scope.password); $http.get( "http://rcp.dev.gdy.io" ).then( function successCallback(response) { console.log(response); }, function errorCallback(response) { console.log(response); } ) } });