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