|
|
@@ -0,0 +1,74 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
+using Microsoft.Extensions.Logging;
|
|
|
+using Microsoft.Extensions.Options;
|
|
|
+using System.DrawingCore.Imaging;
|
|
|
+using System.IO;
|
|
|
+using Library;
|
|
|
+using MySystem.Areas.Admin.Controllers;
|
|
|
+using System.Collections;
|
|
|
+using LitJson;
|
|
|
+using System.Globalization;
|
|
|
+using System.Web;
|
|
|
+
|
|
|
+namespace MySystem.Areas.Api.Controllers
|
|
|
+{
|
|
|
+ [Area("Api")]
|
|
|
+ [Route("Api/[controller]/[action]")]
|
|
|
+ public class MiniProgramController : Admin.Controllers.BaseController
|
|
|
+ {
|
|
|
+ public MiniProgramController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 小程序-获取secret
|
|
|
+
|
|
|
+ public JsonResult GetSecret(string value)
|
|
|
+ {
|
|
|
+ value = DesDecrypt(value);
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
+ string AppId = data["AppId"].ToString();
|
|
|
+ string AuthCode = data["AuthCode"].ToString();
|
|
|
+ Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
+ Obj.Add("AppSecret", "QJHQJ45G6FPFDAG66JBA5XXX2VTT9APT");
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 小程序-获取secret
|
|
|
+
|
|
|
+ public JsonResult Auth(string value)
|
|
|
+ {
|
|
|
+ value = DesDecrypt(value);
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
+ string AppId = data["AppId"].ToString();
|
|
|
+ string Code = data["Code"].ToString();
|
|
|
+ string Data = dbconn.Decrypt3DES(Code);
|
|
|
+ Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
+ Obj.Add("AppSecret", "QJHQJ45G6FPFDAG66JBA5XXX2VTT9APT");
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 小程序-获取secret
|
|
|
+
|
|
|
+ public JsonResult GetUserInfo(string value)
|
|
|
+ {
|
|
|
+ value = DesDecrypt(value);
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
+ string AppId = data["AppId"].ToString();
|
|
|
+ string AuthCode = data["AuthCode"].ToString();
|
|
|
+ Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
+ Obj.Add("AppSecret", "QJHQJ45G6FPFDAG66JBA5XXX2VTT9APT");
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+}
|