Initial_commit_SecMPS_v2
This commit is contained in:
31
api_sqlsugar/VolPro.Core/Extensions/ServerExtension.cs
Normal file
31
api_sqlsugar/VolPro.Core/Extensions/ServerExtension.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using VolPro.Core.BaseProvider.ServerMapPath;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VolPro.Core.Extensions.AutofacManager;
|
||||
|
||||
namespace VolPro.Core.Extensions
|
||||
{
|
||||
public static class ServerExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的路径后面不带/,拼接时需要自己加上/
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
public static string MapPath(this string path)
|
||||
{
|
||||
return MapPath(path, false);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="rootPath">获取wwwroot路径</param>
|
||||
/// <returns></returns>
|
||||
public static string MapPath(this string path,bool rootPath)
|
||||
{
|
||||
return AutofacContainerModule.GetService<IPathProvider>().MapPath(path,rootPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user