lqq 8 년 전
부모
커밋
96270ab52a
2개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 8 8
      web12345-new/src/js/service/auth2Service.js
  2. 2 2
      web12345-new/src/js/service/messageService.js

+ 8 - 8
web12345-new/src/js/service/auth2Service.js

@@ -5,9 +5,9 @@
         .module('app')
         .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.checkAuthByCookie = checkAuthByCookie;
         this.checkAuthByServer = checkAuthByServer;
@@ -19,12 +19,12 @@
         }
 
         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() {

+ 2 - 2
web12345-new/src/js/service/messageService.js

@@ -1,10 +1,10 @@
 'use strict';
 
-angular.module('app').service('messageService', ['$http', '$cookies', '$location', 'userService', function($http, $cookies, $location, userService) {
+angular.module('app').service('messageService', ['$http', '$cookies', 'userService', function($http, $cookies, userService) {
     var self = this;
 
     this.submit = function(bundle, successCallback, failsCallback) {
         bundle.userId = userService.getMe().Id;
-        $http.post($location.protocol() + '://' + $location.host() + ':' + $location.port() + '/api/bundle', bundle).then(successCallback, failsCallback);
+        $http.post('/api/bundle', bundle).then(successCallback, failsCallback);
     }
 }]);