DTcms.API/DTcms.API.OAuth/feixin_helper.cs

(开头部分) 1KB

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

using DTcms.Common;
using System;
using System.Collections.Generic;

namespace DTcms.API.OAuth
{
	public class feixin_helper
	{
		public static System.Collections.Generic.Dictionary<string, object> get_access_token(string code)
		{
			oauth_config config = oauth_helper.get_config("feixin");
			string send_url = string.Concat(new string[]
			{
				"https://i.feixin.10086.cn/oauth2/access_token?grant_type=authorization_code&code=",
				code,
				"&client_id=",
				config.oauth_app_id,
				"&client_secret=",
				config.oauth_app_key,
				"&redirect_uri=",
				Utils.UrlEncode(config.return_uri)
			});
			string result = Utils.HttpGet(send_url);
			System.Collections.Generic.Dictionary<string, object> result2;
			if (result.Contains("error"))
			{
				result2 = null;
			}
			else
			{
				try
				{
					System.Collections.Generic.Dictionary<string, object> dic = JsonHelper.DataRowFromJSON(result);
					result2 = dic;
				}
				catch
				{
					result2 = null;
				}
			}
			return result2;
		}

		public static System.Collections.Generic.Dictionary<string, object> get_info(string access_token)
		{
			string send_url = "https://i.feixin.10086.cn/api/user.json?access_token=" + access_token;
			string result = Utils.HttpGet(send_url);
			System.Collections.Generic.Dictionary<string, object> result2;
			if (result.Contains("error"))
			{
				result2 = null;
			}
			else
			{
				try
				{
					System.Collections.Generic.Dictionary<string, object> dic = JsonHelper.DataRowFromJSON(result);
					result2 = dic;
				}
				catch
后面还有 8 行代码,购买后查看完整代码

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

AI 解读 AI

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

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