diff --git a/ahserver/auth_api.py b/ahserver/auth_api.py index bb0a59a..cafece1 100644 --- a/ahserver/auth_api.py +++ b/ahserver/auth_api.py @@ -36,19 +36,8 @@ class AuthAPI: # setup aiohttp_auth.auth middleware in aiohttp fashion auth.setup(app, policy) app.middlewares.append(self.checkAuth) - # app.router.add_route('POST','/login',self.login) app.router.add_route('GET', '/logout', self.logout) - async def login(self,request): - params = await request.post() - user_id = params.get('user',None) - password = params.get('password',None) - from_path = params.get('from_path',None) - if await self.checkUserPassword(user_id,password): - await auth.remember(request, user) - return web.HpptFound(from_path) - raise web.HTTPUnauthorized() - async def checkLogin(self,request): """ authorization header has the format: diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index b22a1c6..e25f29d 100644 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -20,6 +20,7 @@ from aiohttp.web_routedef import AbstractRouteDef from appPublic.jsonConfig import getConfig from appPublic.MiniI18N import getI18N from appPublic.dictObject import DictObject, multiDict2Dict +from appPublic.timecost import TimeCost from .baseProcessor import getProcessor from .xlsxdsProcessor import XLSXDataSourceProcessor @@ -117,6 +118,15 @@ class ProcessorResource(StaticResource,Url2File): return ns async def _handle(self,request:Request) -> StreamResponse: + t = TimeCost() + name = str(request.url) + t.begin(name) + x = self._handle1(request) + t.end(name) + print(name,':', ':'.join(t.getTimeCost(name))) + return x + + async def _handle1(self,request:Request) -> StreamResponse: clientkeys = { "iPhone":"iphone", "iPad":"ipad",