heyuntao
2023-05-05 cc09b6fe6ffac34a4eeeb26d313b187713cae0de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using CommonUtil;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
 
namespace Api.Operater.Controllers
{
    [Route(TopConstants.API_ROUTE)]
    public class AlibabaOAuthController : ControllerBase
    {
        /// <summary>
        /// 1688授权回调
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        [HttpGet]
        public ActionResult<string> AuthBack(string code)
        {
            LogUtil.Info($"code:{code}", "授权回调");
            //使用code获取令牌
            string appkey = "";
            string secret = "";
            string redidectUrl = "";
            string url = $"https://gw.open.1688.com/openapi/http/1/system.oauth2/getToken/YOUR_APPKEY?grant_type=authorization_code&need_refresh_token=true&client_id= {appkey}&client_secret= {secret}&redirect_uri={redidectUrl}&code={code}";
            return Ok(true);
        }
    }
}