|
@@ -182,6 +182,17 @@ class ModelService:
|
|
|
file.flush()
|
|
|
file.close()
|
|
|
|
|
|
+ @staticmethod
|
|
|
+ def update_log(ip, userID, operation, content, id):
|
|
|
+ content['xid'] = id
|
|
|
+ file_path = '/'.join((BASE_DIR, 'static/update_device.log'))
|
|
|
+ file = open(file_path, 'a+')
|
|
|
+ file.write(ip + "; username:" + userID + "; time:" + time.strftime(
|
|
|
+ "%Y-%m-%d %H:%M:%S", time.localtime()) + "; content:" + json.dumps(content) + "; " + operation)
|
|
|
+ file.write('\n')
|
|
|
+ file.flush()
|
|
|
+ file.close()
|
|
|
+
|
|
|
@staticmethod
|
|
|
def delete_log(ip, userID, operation, UID):
|
|
|
file_path = '/'.join((BASE_DIR, 'static/delete_device.log'))
|