分离KJD WebService
This commit is contained in:
1 parent
b512ee992f
commit
c7bcae3565
1479 files changed
+376
-595675
No files matched your search
@@ -0,0 +1,199 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.SessionState;
|
||||
using KJD_Web.Utils;
|
||||
|
||||
namespace KJD_Web
|
||||
{
|
||||
public class Global : System.Web.HttpApplication
|
||||
{
|
||||
|
||||
protected void Application_Start(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Session_Start(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_BeginRequest(object sender, EventArgs e)
|
||||
{
|
||||
string hPath = Request.Url.LocalPath.ToString();
|
||||
if (!hPath.Contains(".asmx") && hPath.Contains("/user/"))
|
||||
{
|
||||
hPath = hPath.Replace("/user/", "/UserService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/shop/", "/ShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
{
|
||||
hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/order/"))
|
||||
{
|
||||
hPath = hPath.Replace("/order/", "/OrderService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/product/"))
|
||||
{
|
||||
hPath = hPath.Replace("/product/", "/ProductService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/product_third/"))
|
||||
{
|
||||
hPath = hPath.Replace("/product_third/", "/ProductThirdService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/price/", "/PriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
|
||||
|
||||
if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_user/"))
|
||||
{
|
||||
hPath = hPath.Replace("/bxx_user/", "/BXXUserService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/bxx_shop/", "/BXXShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product/"))
|
||||
{
|
||||
hPath = hPath.Replace("/bxx_product/", "/BXXProductService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_product_third/"))
|
||||
{
|
||||
hPath = hPath.Replace("/bxx_product_third/", "/BXXProductThirdService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/bxx_price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/bxx_price/", "/BXXPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
|
||||
|
||||
if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_user/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_user/", "/DYUserService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_shop/", "/DYShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_product/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_product/", "/DYProductService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_product_third/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_product_third/", "/DYProductThirdService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/dyxd_price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/dyxd_price/", "/DYPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_user/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_user/", "/WXUserService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_shop/", "/WXShopService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
//else if (!hPath.Contains(".asmx") && hPath.Contains("/update/"))
|
||||
//{
|
||||
// hPath = hPath.Replace("/update/", "/UpdateService.asmx/");
|
||||
// Context.RewritePath(hPath);
|
||||
//}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_product/", "/WXProductService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_product_third/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_product_third/", "/WXProductThirdService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_price/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_price/", "/WXPriceService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_order/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_order/", "/WXOrderService.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_shop_revenue_statistics/"))
|
||||
{
|
||||
hPath = hPath.Replace("/wxxd_shop_revenue_statistics/", "/WXShopRevenueStatistics.asmx/");
|
||||
Context.RewritePath(hPath);
|
||||
}
|
||||
// 请求录制:捕获请求链接与请求内容,用于迁移后的回放校验
|
||||
//try { ApiRequestLogger.BeginRequest(Context); } catch { }
|
||||
}
|
||||
|
||||
protected void Application_AuthenticateRequest(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_EndRequest(object sender, EventArgs e)
|
||||
{
|
||||
// 请求录制:合并响应内容并落盘
|
||||
//try { ApiRequestLogger.EndRequest(Context); } catch { }
|
||||
}
|
||||
|
||||
protected void Application_Error(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Session_End(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_End(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user