diff --git a/report.py b/report.py index 1365bd10212dcba06604f114021270e822ae28f8..353574b45af261c071b76078b2ef5af9bce38138 100644 --- a/report.py +++ b/report.py @@ -3,6 +3,7 @@ import json from deco import * from res import * import oppressor as OP +import datetime Report = Blueprint('report', __name__) @@ -11,6 +12,7 @@ Report = Blueprint('report', __name__) def submitReport_NoToken(): report = json_data().get('report') f = open('./report.log', 'a+') - f.write(report + '\n') + # 2021.11.22 10.40 Modified by nekomoyi + f.write('[' + datetime.datetime.now() + '] ' + report + '\n') f.close() - return {"type":"SUCCESS", "message":"提交成功"} \ No newline at end of file + return {"type":"SUCCESS", "message":"提交成功"} diff --git a/res.py b/res.py index c34db199ba2526eeb075e826abed607f7e95ff32..1c826a3e1306de43483995118b26f1245a93643c 100644 --- a/res.py +++ b/res.py @@ -20,5 +20,5 @@ def checkPermission(cls,pms,stu): # 判断一个用户是否有权限管理该 # 班级编号为6位:202001,学号为8位:20200100~20200199 return pms in [PMS_CLASS,PMS_TEACHER,PMS_SYSTEM] or(pms==PMS_CLASS and stu>=cls*100 and stu