Commit a0cf1088 authored by xianyang's avatar xianyang

优化每天第一次报错问题

parent 8dde2c78
......@@ -39,8 +39,7 @@ async def add_process_time_header(request: Request, call_next):
payload = jwt.decode(token.replace('Bearer','').replace(' ',''), env.SECRET_KEY, algorithms=[env.ALGORITHM])
except Exception as e:
print(e)
finally:
payload = jwt.decode(token.replace('Bearer','').replace(' ',''), env.SECRET_KEY, algorithms=[env.ALGORITHM])
return response
timestamp = payload.get("exp")
access_token_expires = timedelta(hours=time_format(timestamp))
create_access_token({'username':payload.get("xup"),'password':payload.get("password")},expires_delta=access_token_expires) #更新token时间
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment