stlye: 添加数据库配置打印
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Volo.Abp;
|
using Volo.Abp;
|
||||||
@@ -24,7 +27,6 @@ namespace Yi.Framework.SqlSugarCore
|
|||||||
var configuration = service.GetConfiguration();
|
var configuration = service.GetConfiguration();
|
||||||
Configure<DbConnOptions>(configuration.GetSection("DbConnOptions"));
|
Configure<DbConnOptions>(configuration.GetSection("DbConnOptions"));
|
||||||
|
|
||||||
|
|
||||||
service.TryAddScoped<ISqlSugarDbContext, SqlSugarDbContext>();
|
service.TryAddScoped<ISqlSugarDbContext, SqlSugarDbContext>();
|
||||||
|
|
||||||
//不开放sqlsugarClient
|
//不开放sqlsugarClient
|
||||||
@@ -48,8 +50,22 @@ namespace Yi.Framework.SqlSugarCore
|
|||||||
//进行CodeFirst
|
//进行CodeFirst
|
||||||
var service = context.ServiceProvider;
|
var service = context.ServiceProvider;
|
||||||
var options = service.GetRequiredService<IOptions<DbConnOptions>>().Value;
|
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
|
//Todo:准备支持多租户种子数据及CodeFirst
|
||||||
|
|
||||||
if (options.EnabledCodeFirst)
|
if (options.EnabledCodeFirst)
|
||||||
|
|||||||
@@ -100,11 +100,11 @@
|
|||||||
<el-table-column label="请求方式" align="center" prop="requestMethod" />
|
<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="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="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">
|
<template #default="scope">
|
||||||
<dict-tag :options="sys_common_status" :value="scope.row.state" />
|
<dict-tag :options="sys_common_status" :value="scope.row.state" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="操作日期" align="center" prop="creationTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
|
<el-table-column label="操作日期" align="center" prop="creationTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.creationTime) }}</span>
|
<span>{{ parseTime(scope.row.creationTime) }}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user