From fccd6bb950e215eb74274e671c397e8430343f1c Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 4 Apr 2023 17:45:45 +0800 Subject: [PATCH] =?UTF-8?q?jwt=5Ftoken=E6=9C=89=E6=95=88=E6=9C=9F=E5=BB=B6?= =?UTF-8?q?=E9=95=BF=E5=88=B010=E5=88=86=E9=92=9F=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=97=B6=E9=97=B4=E8=AF=AF?= =?UTF-8?q?=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/bot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/bot.rb b/app/models/bot.rb index 2098ac1e2..13ac70a78 100644 --- a/app/models/bot.rb +++ b/app/models/bot.rb @@ -36,7 +36,7 @@ class Bot < ApplicationRecord def self.decode_jwt_token(token) decoded_token = JWT.decode token, nil, false - return [nil, "Token已过期"] if Time.now.to_i - 60 - decoded_token[0]["exp"].to_i > 0 + return [nil, "Token已过期"] if Time.now.to_i - 10*60 - decoded_token[0]["exp"].to_i > 0 bot = Bot.find_by(id: decoded_token[0]["iss"]) return [nil, "Token不存在"] if bot.blank? rsa_private = OpenSSL::PKey::RSA.new(bot.private_key)