提交
This commit is contained in:
parent
8926f25ee9
commit
aa8a1f9196
|
|
@ -1,5 +1,6 @@
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
using System;
|
||||
|
||||
namespace Infrastructure
|
||||
|
|
@ -28,6 +29,7 @@ namespace Infrastructure
|
|||
.AllowCredentials()//允许cookie
|
||||
.AllowAnyMethod();//允许任意方法
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ using ZR.ServiceCore.Signalr;
|
|||
using ZR.ServiceCore.SqlSugar;
|
||||
using ZR.Mall;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using Infrastructure;
|
||||
//using SQLitePCL;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
|
@ -31,7 +32,9 @@ builder.Services.AddSwaggerGen();
|
|||
//注入HttpContextAccessor
|
||||
builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
// 跨域配置
|
||||
#if DEBUG
|
||||
builder.Services.AddCors(builder.Configuration);
|
||||
#endif
|
||||
//消除Error unprotecting the session cookie警告
|
||||
builder.Services.AddDataProtection()
|
||||
.PersistKeysToFileSystem(new DirectoryInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "DataProtection"));
|
||||
|
|
@ -155,7 +158,9 @@ app.Use((context, next) =>
|
|||
app.UseStaticFiles();
|
||||
//开启路由访问
|
||||
app.UseRouting();
|
||||
#if DEBUG
|
||||
app.UseCors("Policy");//要放在app.UseEndpoints前。
|
||||
#endif
|
||||
//app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthentication();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"dbConfigs": [
|
||||
{
|
||||
"Conn": "Data Source=192.168.1.41;User ID=sa;Password=Dbt@com@123;Initial Catalog=ZrAdmin;Encrypt=True;TrustServerCertificate=True;",
|
||||
"Conn": "Data Source=192.168.195.8;User ID=sa;Password=Dbt@com@123;Initial Catalog=ZrAdmin;Encrypt=True;TrustServerCertificate=True;",
|
||||
"DbType": 1, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||
"ConfigId": "0", //多租户唯一标识
|
||||
"IsAutoCloseConnection": true
|
||||
|
|
@ -25,12 +25,12 @@
|
|||
//代码生成数据库配置 初始化数据:http://localhost:8888/common/initseedData
|
||||
"CodeGenDbConfig": {
|
||||
//代码生成连接字符串,注意{dbName}为固定格式,不要填写数据库名
|
||||
"Conn": "Data Source=192.168.1.41;User ID=sa;Password=Dbt@com@123;Encrypt=True;TrustServerCertificate=True;Initial Catalog={dbName};",
|
||||
"Conn": "Data Source=192.168.195.8;User ID=sa;Password=Dbt@com@123;Encrypt=True;TrustServerCertificate=True;Initial Catalog={dbName};",
|
||||
"DbType": 1,
|
||||
"IsAutoCloseConnection": true,
|
||||
"DbName": "ZrAdmin" //代码生成默认连接数据库,Oracle库是实例的名称
|
||||
},
|
||||
"urls": "http://localhost:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"urls": "http://*:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"corsUrls": [ "http://localhost:8887", "http://localhost:8886" ], //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||||
"JwtSettings": {
|
||||
"Issuer": "ZRAdmin.NET", //即token的签发者。
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user