[英]Angular $http changing url on Rails Devise
這是我有史以來第一個堆棧溢出問題,因為Google通常會將我分類。 但是,我似乎找不到任何東西/任何人在線復制我的問題。
我正在使用Angular Devise模塊,當我嘗試使用以下URL登錄時
test.aam.tunnel.logicsaas-development.com:3000/users/sign_in.json
$ http或Devise將其更改為
http:// undefined:undefinedtest.aam.tunnel.logicsaas-development.com:3000 / users / sign_in.json
這是我的配置代碼:
AuthInterceptProvider.interceptAuth(true);
AuthProvider.loginPath('test.aam.tunnel.logicsaas-development.com:3000/users/sign_in.json');
AuthProvider.loginMethod('POST');
AuthProvider.resourceName('users');
和我的登錄電話:
var credentials = {
email: 'user@domain.com',
password: 'password1'
};
Auth.login(credentials).then(function(user) {
console.log(user); // => {id: 1, ect: '...'}
}, function(error) {
console.log(error)
// Authentication failed...
});
我進行了研究,並且99%的人確信$ http會發生這種情況。 任何幫助將不勝感激
也許您必須使用以下方式更改主機配置:
.config(function(AuthProvider){ AuthProvider.baseUrl("http://test.aam.tunnel.logicsaas-development.com:3000"); })
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.