DTcms.API/DTcms.API.OAuth/qq_helper.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using DTcms.Common;
using System;
using System.Collections.Generic;
namespace DTcms.API.OAuth
{
public class qq_helper
{
public static System.Collections.Generic.Dictionary<string, object> get_access_token(string code, string state)
{
oauth_config config = oauth_helper.get_config("qq");
string send_url = string.Concat(new string[]
{
"https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=",
config.oauth_app_id,
"&client_secret=",
config.oauth_app_key,
"&code=",
code,
"&state=",
state,
"&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
{
string[] parm = result.Split(new char[]
{
'&'
});
string access_token = parm[0].Split(new char[]
{
'='
})[1];
string expires_in = parm[1].Split(new char[]
{
'='
})[1];
result2 = new System.Collections.Generic.Dictionary<string, object>
{
{
"access_token",
access_token
},
{
"expires_in",
expires_in
}
};
}
catch
{
后面还有 92 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。