1
This commit is contained in:
@@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.AP;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using log4net;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Common;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Models;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.Controllers.U8
|
||||
{
|
||||
public class DPController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志组件
|
||||
/// </summary>
|
||||
protected readonly ILog logInfo = LogManager.GetLogger("logInfo");
|
||||
|
||||
/// <summary>
|
||||
/// U8登录接口
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/DP/Login")]
|
||||
public async Task<BaseResult<string>> Login( [FromBody] LoginParamter input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var logn = new BaseLogin();
|
||||
|
||||
logn.Init(input, false);
|
||||
|
||||
var userToken = logn.userToken;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(userToken))
|
||||
{
|
||||
return new BaseResult<string>() { bSuccess = true, message = "登录成功", result = userToken };
|
||||
}
|
||||
|
||||
await Task.Delay(1);
|
||||
|
||||
throw new Exception("未知错误,请检查系统日志");
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "登录失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取U8密码
|
||||
/// </summary>
|
||||
/// <param name="cPwd"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("api/U8/DP/GetPassword")]
|
||||
public async Task<BaseResult<string>> GetPassword(string cPwd)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new BaseResult<string>() { bSuccess = true, message = "加密成功", result = CommonHelper.U8Encrypt(cPwd) };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<string> { bSuccess = false, message = "登录失败", result = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取对接账套设置
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/U8/DP/GetAccountConfig")]
|
||||
public async Task<BaseResult<dynamic>> GetAccountConfig([FromBody] U8AccountConfigInput input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var db = CommUnit.GetDbClient();
|
||||
|
||||
var res = await db.Queryable<Common.Entity.SysU8AccountConfig>()
|
||||
.Where(a => a.cAccountNo == input.cAccId)
|
||||
.FirstAsync();
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = true, message = "查询成功", result = res };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logInfo.Error(ex.Message, ex);
|
||||
|
||||
return new BaseResult<dynamic> { bSuccess = false, message = "查询失败", result = ex.Message };
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,11 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.JScript;
|
||||
using SqlSugar;
|
||||
using UFIDA.U8.Framework.Api.Common.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
using UFIDA.U8.Framework.Api.Models;
|
||||
using Yitter.IdGenerator;
|
||||
using System.Web.UI.WebControls;
|
||||
using Convert = System.Convert;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.AP;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Models;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Entity;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.ST;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.U8M;
|
||||
using UFIDA.U8.Framework.Api.Unit;
|
||||
|
||||
Reference in New Issue
Block a user