You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
using Znyc.CloudCar.Auth.Manual;
|
|
using Znyc.CloudCar.Configuration;
|
|
using Znyc.CloudCar.Model.ViewModels.WeChat;
|
|
|
|
namespace Znyc.CloudCar.Auth.AccressToken
|
|
{
|
|
/// <summary>
|
|
/// 微信帮助类
|
|
/// </summary>
|
|
public class WeChatCacheAccessTokenHelper
|
|
{
|
|
/// <summary>
|
|
/// 获取微信小程序accessToken
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static string GetWxOpenAccessToken()
|
|
{
|
|
var wxOpenAccessToken = ManualDataCache.Instance.Get<string>(GlobalEnumVars.AccessTokenEnum.WxOpenAccessToken.ToString());
|
|
return wxOpenAccessToken;
|
|
}
|
|
|
|
public static string GetWeChatAccessToken()
|
|
{
|
|
//获取微信AccessToken
|
|
var weChatAccessToken = ManualDataCache.Instance.Get<WeChatAccessToken>(GlobalEnumVars.AccessTokenEnum.WeiXinAccessToken.ToString());
|
|
#pragma warning disable CS8603 // 可能返回 null 引用。
|
|
return weChatAccessToken?.AccessToken;
|
|
#pragma warning restore CS8603 // 可能返回 null 引用。
|
|
}
|
|
}
|
|
}
|
|
|