Qc 之前
This commit is contained in:
@@ -12,6 +12,7 @@ using DOAN.Common.DynamicApiSimple.Extens;
|
||||
using DOAN.Infrastructure.WebExtensions;
|
||||
using DOAN.ServiceCore.Signalr;
|
||||
using DOAN.ServiceCore.SqlSugar;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
// NLog: Setup NLog for Dependency injection
|
||||
@@ -134,6 +135,19 @@ app.Use((context, next) =>
|
||||
return next();
|
||||
});
|
||||
//开启访问静态文件/wwwroot目录文件,要放在UseRouting前面
|
||||
|
||||
var fileProvider = new PhysicalFileProvider(InternalApp.Configuration.GetSection("Upload").GetSection("rootDirectory").Get<string>());
|
||||
var requestPath = "/device";
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = fileProvider,
|
||||
RequestPath = requestPath
|
||||
});
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = fileProvider
|
||||
});
|
||||
|
||||
app.UseStaticFiles();
|
||||
//开启路由访问
|
||||
app.UseRouting();
|
||||
@@ -165,5 +179,14 @@ app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
|
||||
app.UseDirectoryBrowser(new DirectoryBrowserOptions
|
||||
{
|
||||
FileProvider = fileProvider,
|
||||
RequestPath = requestPath
|
||||
});
|
||||
app.Run();
|
||||
@@ -3,7 +3,7 @@
|
||||
{
|
||||
// 远程测试服务器
|
||||
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=bzfm_mes;Port=3308",
|
||||
// "Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
||||
// "Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
||||
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||
"ConfigId": "0", //多租户唯一标识
|
||||
"IsAutoCloseConnection": true
|
||||
@@ -19,6 +19,15 @@
|
||||
"DbName": "bzfm_mes" //代码生成默认连接数据库,Oracle库是实例的名称
|
||||
},
|
||||
"ShowDbLog": true, //是否打印db日志
|
||||
"urls": "http://localhost:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"corsUrls": [ "http://localhost:8887", "http://localhost:8886", "http://localhost:9090", "http://localhost:8080" ] //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||||
"urls": "http://0.0.0.0:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"corsUrls": [ "http://localhost:8887", "http://localhost:8886", "http://localhost:9090", "http://localhost:8080" ], //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||||
"Upload": {
|
||||
"rootDirectory": "D:/MES/file",
|
||||
"uploadUrl": "http://172.18.32.1:8888", //本地存储资源访问路径
|
||||
"localSavePath": "", //本地上传默认文件存储目录 wwwroot
|
||||
"maxSize": 30, //上传文件大小限制 15M
|
||||
"notAllowedExt": [ ".bat", ".exe", ".jar", ".js" ],
|
||||
"requestLimitSize": 100 //请求body大小限制
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,13 +24,7 @@
|
||||
"SingleLogin": false, //是否允许多设备/浏览器登录
|
||||
"workId": 1, //雪花id唯一数字
|
||||
"sqlExecutionTime": 5, //Sql执行时间超过多少秒记录日志并警报
|
||||
"Upload": {
|
||||
"uploadUrl": "http://127.0.0.1:8888", //本地存储资源访问路径
|
||||
"localSavePath": "", //本地上传默认文件存储目录 wwwroot
|
||||
"maxSize": 30, //上传文件大小限制 15M
|
||||
"notAllowedExt": [ ".bat", ".exe", ".jar", ".js" ],
|
||||
"requestLimitSize": 100 //请求body大小限制
|
||||
},
|
||||
|
||||
//阿里云存储配置
|
||||
"ALIYUN_OSS": {
|
||||
"REGIONID": "", //eg:cn-hangzhou
|
||||
|
||||
Reference in New Issue
Block a user