From 9b239e42e2cebe0f06f09d1280aa374f70bd4372 Mon Sep 17 00:00:00 2001 From: pengtao Date: Mon, 9 Sep 2019 20:53:00 +0800 Subject: [PATCH] fix bug --- handler/priv_map.py | 5 ++--- ops/base.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/handler/priv_map.py b/handler/priv_map.py index 54f1795..8b9d18a 100644 --- a/handler/priv_map.py +++ b/handler/priv_map.py @@ -30,6 +30,7 @@ class PrivMaps(Resource): except Exception: log.error(f"get args failed!", exc_info=True) args = {} + myargs = None if myargs: users = myargs.get('args', None) status = myargs.get('status', 0) @@ -88,11 +89,9 @@ class PrivMaps(Resource): def post(self): # log.info(f"args={self.args}") - pdb.set_trace() - myargs = json.loads(my_unquote(self.args['args']).replace("'",'"')) + myargs = json.loads(my_unquote(self.args['args'])) log.info(f"2={myargs}") try: - mymaps = {} mymaps['mapid'] = self.get_newid() mymaps['user'] = myargs['user'] diff --git a/ops/base.py b/ops/base.py index 74705e2..9a29f3b 100644 --- a/ops/base.py +++ b/ops/base.py @@ -3,7 +3,7 @@ from urllib.parse import unquote, quote, urlencode def my_unquote(data): - return unquote(data, 'utf-8') + return unquote(data, 'utf-8').replace("'",'"') def my_quote(data):