初始化db新增配置是否启动
This commit is contained in:
parent
f3b417a522
commit
6c31771605
@ -1,6 +1,8 @@
|
||||
using Infrastructure;
|
||||
using Infrastructure.Helper;
|
||||
using SqlSugar;
|
||||
using SqlSugar.IOC;
|
||||
using System.Reflection;
|
||||
using ZR.Admin.WebApi.Framework;
|
||||
using ZR.Model.System;
|
||||
|
||||
|
||||
@ -81,8 +81,12 @@ builder.Services.AddMvc(options =>
|
||||
builder.Services.AddSwaggerConfig();
|
||||
|
||||
var app = builder.Build();
|
||||
//InternalApp.ServiceProvider = app.Services;
|
||||
//app.Services.InitDb();
|
||||
if (builder.Configuration["InitDb"].ParseToBool() == true)
|
||||
{
|
||||
InternalApp.ServiceProvider = app.Services;
|
||||
app.Services.InitDb();
|
||||
}
|
||||
|
||||
app.UseSwagger();
|
||||
|
||||
//使可以多次多去body内容
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
"SecretKey": "SecretKey-ZRADMIN.NET-20210101",
|
||||
"Expire": 1440 //jwt登录过期时间(分)
|
||||
},
|
||||
"InitDb": false,//是否初始化db
|
||||
"DemoMode": false, //是否演示模式
|
||||
"Upload": {
|
||||
"UploadUrl": "http://localhost:8888", //本地存储资源访问路径
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user