【发布时间】:2016-10-15 15:20:49
【问题描述】:
我有一个科尔多瓦 pp 我在控制器中调用 post 方法 它在浏览器中工作,但在构建和调试 apk 中我得到错误
ionic.bundle.js:23826 POST http://somedomain.com/api/account/validation net::ERR_CACHE_MISS
我的角度控制器
.controller('splashCtrl', function ($scope, $state,$http, userManager, serverConfig) {
//check if the user exist else it will redirect to login
$scope.authenticate = function () {
$http.post(serverConfig.serverUrl + '/api/account/validation').success(function (res,status) {
if (status == '200') {
//check if the user need to change password
if (window.localStorage.getItem('shouldChangePassword') && window.localStorage.getItem('shouldChangePassword')=='true') {
$state.go('setPassword');
return;
}
$state.go('tab.category');
}
}).error(function (data, status) {
console.log(status)
})
}
$scope.authenticate();
})
有什么建议吗?
【问题讨论】:
-
您是否在清单文件中添加了权限?
标签: cordova