forked from Bremen/ESG
updates
parent
e1dce2f537
commit
81b7bd3fe0
|
|
@ -77,7 +77,8 @@ namespace Bremen_ESG.Controllers
|
|||
return Content(JsonConvert.SerializeObject(ret), "application/json;charset=utf-8");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
|
||||
[Route("esg_message")]
|
||||
public async Task<ActionResult> Esg_Message(IFormCollection obj) {
|
||||
result ret = new result();
|
||||
|
|
|
|||
69
Program.cs
69
Program.cs
|
|
@ -1,3 +1,4 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
|
||||
|
|
@ -6,38 +7,59 @@ var builder = WebApplication.CreateBuilder(args);
|
|||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddDefaultPolicy(builder =>
|
||||
{
|
||||
options.AddDefaultPolicy(
|
||||
policy =>
|
||||
{
|
||||
policy.WithOrigins("http://www.bremen.com.tw",
|
||||
"http://bremen.com.tw",
|
||||
"https://www.bremen.com.tw",
|
||||
"https://bremen.com.tw",
|
||||
"http://preview.bremen.com.tw",
|
||||
"https://preview.bremen.com.tw"
|
||||
).AllowAnyMethod().AllowAnyHeader();
|
||||
});
|
||||
});
|
||||
|
||||
//builder.Services.AddCors(options =>
|
||||
//{
|
||||
// options.AddDefaultPolicy(builder =>
|
||||
// {
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
builder
|
||||
.WithOrigins("https://*.bremen.com.tw",
|
||||
"https://localhost:7245",
|
||||
"https://bremen.com.tw")
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader();
|
||||
*/
|
||||
|
||||
builder
|
||||
.WithOrigins(GlobalClass.appsettings("CorsOrigins")
|
||||
.Split(",", StringSplitOptions.RemoveEmptyEntries)
|
||||
.ToArray() ?? Array.Empty<string>())
|
||||
.SetIsOriginAllowedToAllowWildcardSubdomains()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader();
|
||||
// builder
|
||||
// .WithOrigins("https://*.bremen.com.tw",
|
||||
// "https://localhost:7245",
|
||||
// "https://bremen.com.tw")
|
||||
// .AllowAnyMethod()
|
||||
// .AllowAnyHeader();
|
||||
|
||||
|
||||
});
|
||||
// // builder
|
||||
// //.WithOrigins(GlobalClass.appsettings("CorsOrigins")
|
||||
// //.Split(",", StringSplitOptions.RemoveEmptyEntries)
|
||||
// //.ToArray() ?? Array.Empty<string>())
|
||||
// //.SetIsOriginAllowedToAllowWildcardSubdomains()
|
||||
// //.AllowAnyMethod()
|
||||
// //.AllowAnyHeader();
|
||||
|
||||
|
||||
// });
|
||||
//});
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("AllowAll", builder =>
|
||||
builder.AllowAnyOrigin()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader());
|
||||
});
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllersWithViews();
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
|
||||
|
||||
|
|
@ -56,12 +78,13 @@ defaultFilesOptions.DefaultFileNames.Clear();
|
|||
defaultFilesOptions.DefaultFileNames.Add("index.html");
|
||||
defaultFilesOptions.DefaultFileNames.Add("iisstart.htm");
|
||||
app.UseDefaultFiles(defaultFilesOptions);
|
||||
app.UseCors();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseCors("AllowAll");
|
||||
//app.UseCors();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllerRoute(
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@
|
|||
"sender_email": "bremen@bremen.com.tw",
|
||||
"sender_name": "ESG需求聯絡表通知信"
|
||||
},
|
||||
"CorsOrigins": "https://*.bremen.com.tw,https://localhost:7245,https://bremen.com.tw"
|
||||
"CorsOrigins": "https://*.bremen.com.tw,https://localhost:7245,https://bremen.com.tw,https://preview.bremen.com.tw"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -671,11 +671,9 @@ function initSummernote() {
|
|||
// [groupName, [list of button]]
|
||||
['style', ['bold', 'italic', 'underline', 'clear']],
|
||||
['font', ['strikethrough', 'superscript', 'subscript']],
|
||||
['fontsize', ['fontsize']],
|
||||
['color', ['color']],
|
||||
['insert', ['link']],
|
||||
['para', ['ul', 'ol', 'paragraph']],
|
||||
['height', ['height']]
|
||||
['para', ['ul', 'paragraph']]
|
||||
]
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue