增加下载文件时记录日志,增加隐藏swagger接口调试网页

master
孙亮 4 months ago
parent f439e2284a
commit 36c619fb02

@ -28,6 +28,14 @@ namespace CCFlow.DataUser.API
{
foreach (ApiDescription apiDescription in apiExplorer.ApiDescriptions)
{
var _key = "/" + apiDescription.RelativePath.TrimEnd('/');
// ¹ýÂ˽ӿÚ
if (_key.Contains("/WF/API/"))
{
int idx = _key.IndexOf("?", System.StringComparison.Ordinal);
_key = _key.Substring(0, idx);
}
swaggerDoc.paths.Remove(_key);
if (Enumerable.OfType<HiddenApiAttribute>(apiDescription.GetControllerAndActionAttributes<HiddenApiAttribute>()).Any())
{
string key = "/" + apiDescription.RelativePath;

@ -675,6 +675,14 @@ function Down2018(mypk) {
var nodeID = GetQueryString("FK_Node");
var workID = GetQueryString("WorkID");
var FrmAttachmentDBs = new Entities("BP.Sys.FrmAttachmentDBs");
FrmAttachmentDBs.Retrieve("MyPK", mypk);
var fileName = FrmAttachmentDBs[0].FileName;//文件名
var no = webUser.No;//当前登录人ID
var name = webUser.Name;//当前登录人Name
var url = "";
if (plant == "CCFlow") {
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
@ -682,6 +690,7 @@ function Down2018(mypk) {
handler.AddPara("FK_Node", nodeID);
handler.AddPara("MyPK", mypk);
var fileUrl = handler.DoMethodReturnString("AttachmentUpload_Down");
if (typeof fileUrl === "string" && fileUrl.indexOf("/DataUser/") !=-1 && fileUrl.indexOf("url@") == 0) {
var url = fileUrl.replace("url@", "");
window.open(window.location.origin + url);

@ -18,6 +18,7 @@ using BP.WF.Template.SFlow;
using BP.WF.Template.Frm;
using Newtonsoft.Json.Linq;
using System.Web.Configuration;
using System.Net;
namespace BP.WF.HttpHandler
{
@ -5694,6 +5695,7 @@ namespace BP.WF.HttpHandler
string filepath = "";
if (dbAtt.AthSaveWay == AthSaveWay.IISServer)
{
#region 解密下载
//1、先解密到本地
filepath = downDB.FileFullName + ".tmp";
@ -5735,7 +5737,38 @@ namespace BP.WF.HttpHandler
}
#endregion
}
#region 触发接口 BKGY
//string clientIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
string strHostName = System.Net.Dns.GetHostName();
//string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();
string clientIPAddress = "";
IPAddress[] addresses = Dns.GetHostAddresses(strHostName);
foreach (IPAddress addr in addresses)
{
if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
clientIPAddress += addr.ToString();
break;
}
}
string url = "http://172.15.89.222:8080/Personnel/Personnelapi/LogRecording";
string questbody = "";
string result = "";
questbody += "{\r \"OperateUser\": \"";
questbody += BP.Web.WebUser.No;
questbody += "\",\r \"Operate\": \"";
questbody += "下载了" + downDB.FileName + "文件";
questbody += "\",\r \"OperateIp\": \"";
questbody += clientIPAddress;
questbody += "\",\r \"Flag\": \"";
questbody += "1";
questbody += "\",\r}";
result = PubGlo.HttpPostConnect(url, questbody, "POST", true);
if (DataType.IsNullOrEmpty(result) == true)
return "err@请求失败";
#endregion
if (dbAtt.AthSaveWay == AthSaveWay.FTPServer)
{
//下载文件的临时位置
@ -6071,6 +6104,38 @@ namespace BP.WF.HttpHandler
}
//新文件目录
copyToPath = copyToPath + "//" + db.FileName;
#region 触发接口 BKGY
//string clientIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
string strHostName = System.Net.Dns.GetHostName();
//string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();
string clientIPAddress = "";
IPAddress[] addresses = Dns.GetHostAddresses(strHostName);
foreach (IPAddress addr in addresses)
{
if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
clientIPAddress += addr.ToString();
break;
}
}
string urll = "http://172.15.89.222:8080/Personnel/Personnelapi/LogRecording";
string questbody = "";
string result = "";
questbody += "{\r \"OperateUser\": \"";
questbody += BP.Web.WebUser.No;
questbody += "\",\r \"Operate\": \"";
questbody += "下载了" + db.FileName + "文件";
questbody += "\",\r \"OperateIp\": \"";
questbody += clientIPAddress;
questbody += "\",\r \"Flag\": \"";
questbody += "1";
questbody += "\",\r}";
result = PubGlo.HttpPostConnect(urll, questbody, "POST", true);
if (DataType.IsNullOrEmpty(result) == true)
return "err@请求失败";
#endregion
if (File.Exists(fileTempDecryPath) == true)
{

Loading…
Cancel
Save