using Furion;
|
using Furion.DataEncryption;
|
using Furion.HttpRemote;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace FlexJobApi.Core
|
{
|
/// <summary>
|
/// 电子签客户端资源提供者
|
/// </summary>
|
public class ElectronSignServerCustomerResourceHttpProvider : IResourceHttpProvider
|
{
|
public async Task<string> SendAsStringAsync(HttpRequestBuilder builder)
|
{
|
var httpRemoteService = App.GetRequiredService<IHttpRemoteService>();
|
var appId = App.GetConfig<string>("ElectronSignServer:AppId");
|
var privateKey = App.GetConfig<string>("ElectronSignServer:PrivateKey");
|
var sign = MD5Encryption.Encrypt($"{appId}-{privateKey}".ToUpper(), true);
|
builder = builder
|
.WithHeader("appId", appId)
|
.WithHeader("sign", sign);
|
var response = await httpRemoteService.SendAsStringAsync(builder);
|
return response;
|
}
|
}
|
}
|