robert2206 преди 8 години
родител
ревизия
7a34fc0301
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      controllers/http_handler.py
  2. BIN
      controllers/http_handler.pyc

+ 3 - 3
controllers/http_handler.py

@@ -21,7 +21,7 @@ class Auth(http.Controller):
     # --------------------------------------------------------------------------
     # Generate JWT token based on username and password field
     # --------------------------------------------------------------------------
-    @http.route(['/api/jwt'], type = 'http', auth = 'none', methods = ['POST'])
+    @http.route(['/api/jwt'], type = 'http', auth = 'none', methods = ['POST'], cors = '*')
     def get_jwt(self, **args):
         try:
             user = request.env['res.users'].sudo().search([('login', '=', args['username']), ('active', '=', True)])
@@ -45,7 +45,7 @@ class Auth(http.Controller):
     # --------------------------------------------------------------------------
     # Check JWT token auth
     # --------------------------------------------------------------------------
-    @http.route(['/api/check'], type = 'http', auth = 'none')
+    @http.route(['/api/check'], type = 'http', auth = 'none', cors = '*')
     def check_token(self, **args):
         try:
             user = request.env['res.users'].sudo().search([('jwt_token', '=', args['token'])])
@@ -72,6 +72,6 @@ class Auth(http.Controller):
 '''
 class ApiManager(http.Controller):
 
-    @http.route(['/api/customers'], type = 'http', auth = 'none')
+    @http.route(['/api/customers'], type = 'http', auth = 'none', cors = '*')
     def customers(self):
         pass

BIN
controllers/http_handler.pyc