|
@@ -5,9 +5,9 @@
|
|
|
.module('app')
|
|
.module('app')
|
|
|
.service('auth2Service', auth2Service);
|
|
.service('auth2Service', auth2Service);
|
|
|
|
|
|
|
|
- auth2Service.$inject = ['$cookies', '$http', '$location'];
|
|
|
|
|
|
|
+ auth2Service.$inject = ['$cookies', '$http'];
|
|
|
|
|
|
|
|
- function auth2Service($cookies, $http, $location) {
|
|
|
|
|
|
|
+ function auth2Service($cookies, $http) {
|
|
|
this.checkAuthByResponse = checkAuthByResponse;
|
|
this.checkAuthByResponse = checkAuthByResponse;
|
|
|
this.checkAuthByCookie = checkAuthByCookie;
|
|
this.checkAuthByCookie = checkAuthByCookie;
|
|
|
this.checkAuthByServer = checkAuthByServer;
|
|
this.checkAuthByServer = checkAuthByServer;
|
|
@@ -19,12 +19,12 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function checkAuthByServer() {
|
|
function checkAuthByServer() {
|
|
|
- $http.get($location.protocol() + '://' + $location.host() + ':' + $location.port() + '/api/auth/check').then(
|
|
|
|
|
- function () {
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
- checkAuthByResponse
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ $http.get('/api/auth/check').then(
|
|
|
|
|
+ function () {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ checkAuthByResponse
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function checkAuthByCookie() {
|
|
function checkAuthByCookie() {
|