feat: #10000 账号重新授权

This commit is contained in:
赵世界 2022-08-11 18:47:35 +08:00
parent cf910fa6ae
commit a2eb9e27dd

View File

@ -8,7 +8,6 @@ class Shop extends Model
{ {
protected $hidden = [ protected $hidden = [
'access_token', 'access_token',
'expires_at',
'expires_in', 'expires_in',
'refresh_token', 'refresh_token',
'refresh_token_expires_at', 'refresh_token_expires_at',
@ -28,6 +27,9 @@ class Shop extends Model
2 => '无需授权', 2 => '无需授权',
3 => '停用', 3 => '停用',
]; ];
if (1 === (int)$value && ($this->attributes['expires_at'] - time()) / 3600 <= 72) {
return '重新授权';
}
return $map[$value]; return $map[$value];
} }