mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix ua type问题
This commit is contained in:
@@ -6,7 +6,7 @@ import requests
|
||||
from math import radians, cos, sin, asin, sqrt
|
||||
|
||||
from ..lib.user_agents import parse
|
||||
from ..models.ir_http import get_ua_type
|
||||
from ..models.base import get_ua_type
|
||||
|
||||
|
||||
from odoo import api, http, SUPERUSER_ID, _
|
||||
@@ -28,7 +28,7 @@ class AppController(http.Controller):
|
||||
# 返回这个图片的base64编码
|
||||
return base64.b64encode(BytesIO(response.content).read())
|
||||
|
||||
@http.route(['/web/ua', '/web/ua/show'], auth='public', methods=['GET'])
|
||||
@http.route(['/my/ua', '/web/ua', '/web/ua/show'], auth='public', methods=['GET'])
|
||||
def app_ua_show(self):
|
||||
# https://github.com/selwin/python-user-agents
|
||||
ua_string = request.httprequest.headers.get('User-Agent')
|
||||
|
||||
Reference in New Issue
Block a user