stlye: 添加数据库配置打印

This commit is contained in:
陈淳
2024-03-08 13:43:17 +08:00
parent 3b3c778a0f
commit 21fdb41b09
2 changed files with 19 additions and 3 deletions

View File

@@ -1,6 +1,9 @@
using System.Reflection;
using System.Text;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using SqlSugar;
using Volo.Abp;
@@ -24,7 +27,6 @@ namespace Yi.Framework.SqlSugarCore
var configuration = service.GetConfiguration();
Configure<DbConnOptions>(configuration.GetSection("DbConnOptions"));
service.TryAddScoped<ISqlSugarDbContext, SqlSugarDbContext>();
//不开放sqlsugarClient
@@ -49,7 +51,21 @@ namespace Yi.Framework.SqlSugarCore
var service = context.ServiceProvider;
var options = service.GetRequiredService<IOptions<DbConnOptions>>().Value;
var _logger= service.GetRequiredService<ILogger<YiFrameworkSqlSugarCoreModule>>();
StringBuilder sb = new StringBuilder();
sb.AppendLine();
sb.AppendLine("==========Yi-SQL配置:==========");
sb.AppendLine($"数据库连接字符串:{options.Url}");
sb.AppendLine($"数据库类型:{options.DbType.ToString()}");
sb.AppendLine($"是否开启种子数据:{options.EnabledDbSeed}");
sb.AppendLine($"是否开启CodeFirst{options.EnabledCodeFirst}");
sb.AppendLine($"是否开启Saas多租户{options.EnabledSaasMultiTenancy}");
sb.AppendLine("===============================");
_logger.LogInformation(sb.ToString());
//Todo准备支持多租户种子数据及CodeFirst
if (options.EnabledCodeFirst)

View File

@@ -100,11 +100,11 @@
<el-table-column label="请求方式" align="center" prop="requestMethod" />
<el-table-column label="操作人员" align="center" prop="operUser" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" width="100" />
<el-table-column label="主机" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
<el-table-column label="操作状态" align="center" prop="state">
<!-- <el-table-column label="操作状态" align="center" prop="state">
<template #default="scope">
<dict-tag :options="sys_common_status" :value="scope.row.state" />
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="操作日期" align="center" prop="creationTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.creationTime) }}</span>