【发布时间】:2017-02-08 07:33:12
【问题描述】:
我为 Web 应用程序编写了登录信息。在 chrome 中登录有效,但在 Firefox 中无效。
<form ng-submit="$ctrl.login()">
<div class="cClearFloat">
<input type="text" name="Benutzername" placeholder="Benutzername" ng-model="$ctrl.userName">
</div>
<div class="cClearFloat">
<input type="password" name="Passwort" placeholder="Passwort" ng-model="$ctrl.password">
</div>
<div class="cClearFloat">
<div class="cButtonLogin" class="button">
<button class="cLinkLogin" type="submit">Anmelden</button>
</div>
</div>
</form>
登录调用:
login() {
this.userService.login(this.userName, this.password);
}
登录:
login(userName, password) {
this.$http.post("http://localhost:20670/login", { UserName: userName, Password: password }).then((response) => {
this.userInfo = this.hateoasService.fromData(response.data);
this.$http.defaults.headers.common.LoginToken = this.userInfo.LoginToken;
this.isLoggedIn = true;
}, (response) => {
swal({
title: response.data.error,
type: 'error'
})
});
}
当我在 Firefox 中测试它时发生的所有事情都是它重新加载页面。有人知道为什么它不起作用吗?是否有可能重新加载是因为 angularjs 不可用并且他从 ng-submit 中获取默认值?
在我的控制台中我遇到了这个错误
【问题讨论】:
-
我曾经使用过
-
查看您的控制台错误,错误不在您的表单中,而是在某些对象调用中。请检查您的控制台错误的堆栈跟踪。
-
堆栈跟踪用于 angular.min.js 文件
-
然后使用非缩小角度进行调试。这些堆栈跟踪将更具描述性
标签: angularjs google-chrome firefox