更改数据库连接字符串

This commit is contained in:
不做码农 2022-05-31 11:45:20 +08:00
parent ba17a79e6f
commit 1ca160f3c1
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ namespace ZR.Admin.WebApi.Extensions
public static void AddDb(IConfiguration Configuration) public static void AddDb(IConfiguration Configuration)
{ {
string connStr = Configuration.GetConnectionString("conn_db"); string connStr = Configuration.GetConnectionString("conn_db");
int dbType = Convert.ToInt32(Configuration["conn_db_dbtype"]); int dbType = Convert.ToInt32(Configuration.GetConnectionString("conn_db_type"));
SugarIocServices.AddSqlSugar(new List<IocConfig>() { SugarIocServices.AddSqlSugar(new List<IocConfig>() {
new IocConfig() { new IocConfig() {

View File

@ -7,9 +7,9 @@
} }
}, },
"ConnectionStrings": { "ConnectionStrings": {
"conn_db": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;uid=sa;pwd=zradmin123;database=ZrAdmin;Trusted_Connection=SSPI" "conn_db": "Data Source=LAPTOP-STKF2M8H\\SQLEXPRESS;User ID=sa;Password=zradmin123;Initial Catalog=ZrAdmin;Integrated Security=SSPI", //
"conn_db_type": "1" // MySql = 0, SqlServer = 1
}, },
"conn_db_dbtype": 1, // MySql = 0, SqlServer = 1
"urls": "http://localhost:8888", //urldevServer "urls": "http://localhost:8888", //urldevServer
"corsUrls": "http://localhost:8887", //"," "corsUrls": "http://localhost:8887", //","
"JwtSettings": { "JwtSettings": {
@ -32,7 +32,7 @@
"domainUrl": "http://xxx.xxx.com" //访 "domainUrl": "http://xxx.xxx.com" //访
}, },
"gen": { "gen": {
"conn": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;user=zr;pwd=abc;database=ZrAdmin;Trusted_Connection=SSPI", "conn": "Data Source=LAPTOP-STKF2M8H\\SQLEXPRESS;User ID=sa;Password=zradmin123;Initial Catalog=ZrAdmin;Integrated Security=SSPI",
"dbType": 1, //MySql = 0, SqlServer = 1 "dbType": 1, //MySql = 0, SqlServer = 1
"autoPre": true, // "autoPre": true, //
"author": "admin", "author": "admin",