修改测试
parent
1126dd164a
commit
541d2ab34c
|
@ -16,6 +16,7 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
|
||||
namespace IRaCIS.Core.API.Controllers
|
||||
{
|
||||
|
@ -71,7 +72,8 @@ namespace IRaCIS.Core.API.Controllers
|
|||
throw new Exception("当前code 没要找到对应的文件");
|
||||
}
|
||||
|
||||
var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).FullName;
|
||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
|
||||
var filePath = Path.Combine(rootPath, doc.Path.Trim('/'));
|
||||
|
||||
|
|
|
@ -159,6 +159,8 @@ namespace IRaCIS.Core.API
|
|||
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseIRacisHostStaticFileStore(env);
|
||||
|
||||
//LogDashboard
|
||||
app.UseLogDashboard("/LogDashboard");
|
||||
|
||||
|
@ -203,7 +205,7 @@ namespace IRaCIS.Core.API
|
|||
app.UseAuthorization();
|
||||
|
||||
//文件伺服 必须带Token 访问
|
||||
app.UseIRacisHostStaticFileStore(env);
|
||||
//app.UseIRacisHostStaticFileStore(env);
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace IRaCIS.Core.API
|
|||
|
||||
//仅仅是访问文件的时候才会去取token认证 前端对cookie设置了有效期
|
||||
|
||||
if (context.Request.Path.ToString().Contains("IRaCISData")|| context.Request.Path.ToString().Contains("SystemData") )
|
||||
if (context.Request.Path.ToString().Contains("IRaCISData") || context.Request.Path.ToString().Contains("SystemData") )
|
||||
{
|
||||
var cookieToken = context.Request.Cookies["access_token"];
|
||||
|
||||
|
|
Loading…
Reference in New Issue