tanghongbin 4 жил өмнө
parent
commit
a14fd334ab

+ 2 - 1
Service/CommonService.py

@@ -14,6 +14,7 @@ from Ansjer.config import BASE_DIR, UNICODE_ASCII_CHARACTER_SET
 
 # 复用性且公用较高封装代码在这
 from Controller.CheckUserData import RandomStr
+from Service.ModelService import ModelService
 
 
 class CommonService:
@@ -99,7 +100,7 @@ class CommonService:
         # ip数据库
         db = IPIPDatabase(base_dir + '/DB/17monipdb.dat')
         addr = db.lookup(ip)
-        print(addr)
+        ModelService.add_tmp_log(addr)
         ts = addr.split('\t')[0]
         return ts
 

+ 9 - 0
Service/ModelService.py

@@ -213,6 +213,15 @@ class ModelService:
         file.flush()
         file.close()
 
+    @staticmethod
+    def add_tmp_log(info):
+        file_path = '/'.join((BASE_DIR, 'static/tmp_test.log'))
+        file = open(file_path, 'a+')
+        file.write("info:" + str(info))
+        file.write('\n')
+        file.flush()
+        file.close()
+
 
 def notify_alexa_delete(userID, UID):
     url = 'https://www.zositech.xyz/deviceStatus/delete'