Files
juipnet/Infrastructure/WxApi/Response/WxResponseBase.cs
“wanyongkang” ed3b2c653e 接口文件
2024-04-10 13:55:27 +08:00

24 lines
759 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Hncore.Infrastructure.Extension;
using System;
namespace Hncore.Wx.Open
{
public class ResponseBase
{
public int errcode { get; set; }
public string errmsg { get; set; }
public int expires_in { get; set; }
public long create_from { get; set; }
public virtual bool need_to_refresh_token
{
get
{
var timespan = (DateTime.Now.TimestampFrom19700101() - create_from);
//此处不应该等于0 errcode=0表明微信返回的token有错误 需要刷新 ==0是正确的
//提前10分钟过期
return errcode != 0 || timespan < 0 || timespan > expires_in-10*60;
}
}
}
}