| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using molilian.core;
- using dodohold.core;
- using Microsoft.AspNetCore.Mvc;
- using Org.BouncyCastle.Ocsp;
- using System.Text.Json;
- using System.Runtime.InteropServices;
- using System.Net;
- using System.Security.Cryptography;
- using Microsoft.AspNetCore.Authentication;
- using TencentCloud.Ecm.V20190719.Models;
- using Dataoke;
- namespace molilian.api.Controllers
- {
- [ApiController]
- [Route("[controller]/[action]")]
- public class H5Controller : ControllerBase
- {
- protected IHttpContextAccessor _accessor;
- public H5Controller(IHttpContextAccessor accessor)
- {
- _accessor = accessor;
- }
- [HttpGet]
- public ActionResult sign()
- {
- var api = DataokeCore.GetOne();
- if (api == null)
- {
- return new APIResult(new
- {
- success = false,
- message = "没有可用签名账户"
- });
- }
- int nonce;
- string timer;
- DtkApp app = new(api.app_key, api.app_secret);
- string sign = app.MakeSign(out nonce, out timer);
- string sign_url = $"appKey={api.app_key}&nonce={nonce}&signRan={sign}&timer={timer}";
- https://openapi.dataoke.com/api/tb-service/get-privilege-link?appKey=663dc44dcb55f&nonce=955350&signRan=9FFB668FD91AD897C238C536899C92EC&timer=1716116967528&version=v1.3.1&pid=236e3aa943d948339732430b74737328&goodsId=jyn335Ds0tJYG9g9g0IN6PCJte-GPgAyeRIqOVrK3W0HnY&coupon_id=
- return new APIResult(new
- {
- success = true,
- message = "ok",
- sign_url
- });
- }
- /*
- var api = DataokeCore.GetOne();
- if (api == null)
- {
- result.success = false;
- result.message = "内部错误";
- result.reason = "没有匹配账号";
- result.rawContent = content;
- result.rawContent2 = content2;
- TkLogCore.Log(result);
- return new APIResult(result);
- }
- result = DataokeCore.JdParse(result, api, account, content);
- }
- */
- }
- }
|