update 默认路由改为从配置文件读取

This commit is contained in:
2021-05-08 15:01:38 +08:00
parent ad6e8abda8
commit c12ccf5558

View File

@@ -49,24 +49,23 @@ namespace Ewide.Web.Core
{ {
// 管理员跳过判断 // 管理员跳过判断
var userManager = App.GetService<IUserManager>(); var userManager = App.GetService<IUserManager>();
//if (userManager.SuperAdmin) return true; if (userManager.SuperAdmin) return true;
// 路由名称 // 路由名称
var routeName = httpContext.Request.Path.Value.Substring(1).Replace("/", ":"); var routeName = httpContext.Request.Path.Value.Substring(1).Replace("/", ":");
// 默认路由(获取登录用户信息) // 默认路由(获取登录用户信息)
var defalutRoute = new List<string>() var defalutRoute = App.Configuration.GetSection("CoreSettings:DefalutRoute").Get<List<string>>();
{ //var defalutRoute = new List<string>()
"getLoginUser", //{
"logout", // "getLoginUser",
"sysFileInfo:upload", // "logout",
"sysFileInfo:download", // "sysFileInfo:upload",
"sysFileInfo:preview", // "sysFileInfo:download",
"sysUser:updateInfo" // "sysFileInfo:preview",
}; // "sysUser:updateInfo"
//};
var a = App.Configuration["CoreSettings:DefalutRoute:0"];
var b = App.Configuration.GetSection("CoreSettings:DefalutRoute").Get<string[]>();
if (defalutRoute.Contains(routeName)) return true; if (defalutRoute.Contains(routeName)) return true;
// 获取用户权限集合按钮或API接口 // 获取用户权限集合按钮或API接口