/// <summary>
        /// 生成url上面的Ticket,一般只有几秒有效期
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public string GenerateTicket(string userId)
        {
            string sourceString = DateTime.Now.ToString("yyyy-MM-dd") + userId + DateTime.Now.ToString("HH:mm:ss");
            string ticket       = SymmetricEncryptHelper.AesEncode(sourceString, secretKey);

            return(Base64SecureURL.Encode(ticket));
        }
        /// <summary>
        /// string 转成 url 安全的base64 编码
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static string StrToBase64(this string str)
        {
            string base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(str));

            return(Base64SecureURL.Encode(base64));
        }