Explorar o código

诊断日志接口,对上传的uid进行截取操作

tanghongbin %!s(int64=4) %!d(string=hai) anos
pai
achega
9683f6e8b5
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      Controller/AppLogController.py

+ 6 - 1
Controller/AppLogController.py

@@ -71,9 +71,14 @@ class AppLogView(View):
         if uid is None or average_delay is None or status is None or filename is None:
             return response.json(444)
         else:
+            if len(uid) < 20:
+                return response.json(444, 'uid')
+
+            # ModelService.app_log_log(userID, uid)
             now_time = int(time.time())
+            uid = uid.strip()
             data = {
-                'uid': uid,
+                'uid': uid[0:20],
                 'average_delay': average_delay,
                 'status': status,
                 'filename': filename,