Javascript 角度登录不';我不能用iphone6
我在登录我的网站时遇到问题-它在iphone 6上不起作用。 这是我的密码: JS: HTML:Javascript 角度登录不';我不能用iphone6,javascript,ios,angularjs,iphone,Javascript,Ios,Angularjs,Iphone,我在登录我的网站时遇到问题-它在iphone 6上不起作用。 这是我的密码: JS: HTML: 请登录 电子邮件地址 密码 登录 在我的网站在电脑上点击“登录”后,我从服务器上得到cookies,并将我移动到“/家” 当我在iPhone6上单击“登录”时,服务器返回的响应似乎失败了,什么也没有发生。 谢谢您提前回复。我没有看到您的else@PrerakSola的if是的,我更正了。在我的代码中没有那个错误。登录在iphone上仍然不起作用。 $scope.signin = function
请登录
电子邮件地址
密码
登录
在我的网站在电脑上点击“登录”后,我从服务器上得到cookies,并将我移动到“/家”
当我在iPhone6上单击“登录”时,服务器返回的响应似乎失败了,什么也没有发生。
谢谢您提前回复。我没有看到您的
else
@PrerakSola的if
是的,我更正了。在我的代码中没有那个错误。登录在iphone上仍然不起作用。
$scope.signin = function() {
$http({
method: 'POST',
url: link,
data: $.param({
action: 'sign_in',
username: $scope.username,
password: $scope.password
}),
withCredentials: true,
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
.then(function successCallback(response){
if (response.data === true)
console.log(response);
$location.path('/home');
} else {
console.log('wrong stuff');
}
}, function errorCallback(response){
console.log(response);
console.log('error');
});
}
<div class="container" ng-controller="Ctrl">
<form class="form-signin">
<h2 class="form-signin-heading">Please sign in</h2>
<label for="username" class="sr-only">Email address</label>
<input type="username" ng-model="username" id="username" class="form-control" placeholder="Username" required>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" ng-model="password" id="inputPassword" class="form-control" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit" ng-click="signin()">Sign in</button>
</form>
</div>