Forráskód Böngészése

改限制时间为2天

pzb 6 éve
szülő
commit
a2e1b481c2
2 módosított fájl, 3 hozzáadás és 1 törlés
  1. 1 0
      Controller/MealManage.py
  2. 2 1
      Object/UrlTokenObject.py

+ 1 - 0
Controller/MealManage.py

@@ -110,6 +110,7 @@ class MealManage(View):
                     'update_time': str(store_meal.update_time)})
 
     def query(self, request_dict, response):
+
         page = int(request_dict.get('page', None))
         line = int(request_dict.get('line', None))
         if page is None or line is None:

+ 2 - 1
Object/UrlTokenObject.py

@@ -40,7 +40,8 @@ class UrlTokenObject:
     def generate(self, data={}):
         now_stamp = int(time.time())
         # print (now_stamp)
-        data['exp'] = 7200 + now_stamp
+        # 过期时间为两天
+        data['exp'] = 172800 + now_stamp
         token = jwt.encode(data, '12345', algorithm='HS256').decode('utf-8')
         self.token=token
         return token