QiFeng.ZWY.Bll/WxInterfaceFunc/BaseWxInterFunc.cs

(开头部分) 16KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using log4net;
using Newtonsoft.Json;
using QiFeng.LMSD.Bll.WechatCacheActionService;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.Wechat;
using QiFeng.LMSD.Model.WeChat;
using QiFeng.LMSD.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Security;

namespace QiFeng.LMSD.Bll.WxInterfaceFunc
{
    public class BaseWxInterFunc
    {
        private readonly ILog _fileLog = LogManager.GetLogger(typeof(BaseWxInterFunc));

        #region 微信ACCESS TOKEN 方法

        /// <summary>
        ///     获取微信ACCESS_TOKEN
        /// </summary>
        /// <param name="wxAppId"></param>
        /// <param name="wxSecret"></param>
        /// <param name="tokenKey"></param>
        /// <returns></returns>
        public string GetWxToken(string wxAppId, string wxSecret, string tokenKey)
        {
            var strAccessToken = GetWxToken(wxAppId, wxSecret, false, tokenKey);
            if (string.IsNullOrWhiteSpace(strAccessToken))
            {
                strAccessToken = GetWxToken(wxAppId, wxSecret, true, tokenKey);
                if (string.IsNullOrWhiteSpace(strAccessToken))
                {
                    throw new WxErrorMsgException("Cannot get the common accessToken",
                        WxErrorMsgExceptionType.CloudCustomerException);
                }
                return strAccessToken;
            }
            return strAccessToken;
        }

        /// <summary>
        ///     获取微信ACCESS_TOKEN
        /// </summary>
        /// <param name="wxAppId"></param>
        /// <param name="wxSecret"></param>
        /// <param name="renewToken"></param>
        /// <param name="tokenKey"></param>
        /// <returns></returns>
        protected string GetWxToken(string wxAppId, string wxSecret, bool renewToken, string tokenKey)
        {
            const string strInterfaceUrl =
                "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}";


            try
后面还有 367 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。