diff --git a/labs/Teacher/Infrastructure/Views/Shared/DisplayTemplates/Bool.cshtml b/labs/Teacher/Infrastructure/Views/Shared/DisplayTemplates/Bool.cshtml index 486d223a..c7facdb6 100644 --- a/labs/Teacher/Infrastructure/Views/Shared/DisplayTemplates/Bool.cshtml +++ b/labs/Teacher/Infrastructure/Views/Shared/DisplayTemplates/Bool.cshtml @@ -8,6 +8,6 @@ } else { - + } diff --git a/labs/Teacher/Infrastructure/Views/Shared/EditorTemplates/Date.cshtml b/labs/Teacher/Infrastructure/Views/Shared/EditorTemplates/Date.cshtml index 5a77a39b..25cd4641 100644 --- a/labs/Teacher/Infrastructure/Views/Shared/EditorTemplates/Date.cshtml +++ b/labs/Teacher/Infrastructure/Views/Shared/EditorTemplates/Date.cshtml @@ -1,4 +1 @@ -@{ - var value = Model == null ? null : ((DateTime)Model).ToString("yyyy-MM-dd"); -} -@Html.TextBox("", value, new { @class = "form-control date edit-date" }) \ No newline at end of file +@Html.TextBox(null, null, new { @class = "form-control edit-date" }) \ No newline at end of file diff --git a/labs/Teacher/TeacherExt/Controllers/HomeController.cs b/labs/Teacher/TeacherExt/Controllers/HomeController.cs index 12623394..9049fdee 100644 --- a/labs/Teacher/TeacherExt/Controllers/HomeController.cs +++ b/labs/Teacher/TeacherExt/Controllers/HomeController.cs @@ -222,6 +222,7 @@ namespace TeacherExt.Controllers return this.NoContent(); } } + //model = entity.To(); this.EntityToModel(entity, model); this.ToEditModel(entity, model); model.LoginName = login.LoginName; @@ -559,7 +560,7 @@ namespace TeacherExt.Controllers ViewData.SelectList(o => model.Nation, () => this.GetNation(model.Nation)); ViewData.SelectList(o => model.Politics, () => this.GetPolitics(model.Politics)); ViewData.SelectList(o => model.MaxTitle, () => this.GetTitle(model.MaxTitle)); - ViewData.SelectList(o => model.NotMaxTitle, () => this.GetTitle(model.MaxTitle)); + ViewData.SelectList(o => model.NotMaxTitle, () => this.GetTitle(model.NotMaxTitle)); ViewData.SelectList(o => model.Nationality, () => this.GetNationality(model.Nationality)); ViewData.SelectList(o => model.UserType, () => this.GetUserType(model.UserType)); ViewData.SelectList(o => model.PostType, () => this.GetPostType(model.PostType)); @@ -664,7 +665,7 @@ namespace TeacherExt.Controllers row.Export("AD", headers, () => teacher.FullTimeSchool)?.SetCell(++colIndex, style, teacher.FullTimeSchool); row.Export("AE", headers, () => teacher.FullTimeSchoolType)?.SetCell(++colIndex, style, teacher.FullTimeSchoolType); row.Export("AF", headers, () => teacher.FullTimeSchoolMajor)?.SetCell(++colIndex, style, teacher.FullTimeSchoolMajor); - row.Export("AG", headers, () => teacher.FullTimeSchoolEducation)?.SetCell(++colIndex, style, teacher.FullTimeSchoolEducation); + row.Export("AG", headers, () => teacher.FullTimeSchoolEducation)?.SetCell(++colIndex, style, educations.GetText(teacher.FullTimeSchoolEducation)); row.Export("AH", headers, () => teacher.FullTimeSchoolEducationDate)?.SetCell(++colIndex, style, teacher.FullTimeSchoolEducationDate); row.Export("AI", headers, () => teacher.JobTimeSchool)?.SetCell(++colIndex, style, teacher.JobTimeSchool); row.Export("AJ", headers, () => teacher.JobTimeSchoolType)?.SetCell(++colIndex, style, teacher.JobTimeSchoolType); diff --git a/labs/Teacher/TeacherExt/Startup.cs b/labs/Teacher/TeacherExt/Startup.cs index 8810d3f8..ba36948a 100644 --- a/labs/Teacher/TeacherExt/Startup.cs +++ b/labs/Teacher/TeacherExt/Startup.cs @@ -8,12 +8,12 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Localization; -using Microsoft.Extensions.Localization; -using Microsoft.AspNetCore.Mvc.Razor; +using Microsoft.AspNetCore.Mvc.DataAnnotations; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; @@ -26,7 +26,6 @@ using System.Text.Encodings.Web; using System.Text.Unicode; using System.Threading.Tasks; using TeacherExt.Data; -using Microsoft.AspNetCore.Mvc.DataAnnotations; namespace TeacherExt { @@ -74,12 +73,10 @@ namespace TeacherExt services.Configure( options => { - var supportedCultures = new List - { - new CultureInfo("en-US"), - new CultureInfo("zh-CN"), - }; - + var supportedCultures = new List{ + //new CultureInfo("en-US"), + new CultureInfo("zh-CN"), + }; options.DefaultRequestCulture = new RequestCulture(culture: "zh-CN", uiCulture: "zh-CN"); options.SupportedCultures = supportedCultures; options.SupportedUICultures = supportedCultures; @@ -99,7 +96,7 @@ namespace TeacherExt // var localizer = factory.Create("Resources.Resource", Assembly.GetEntryAssembly().GetName().Name); // return localizer; // }; - //}); + //}); services.AddControllers() .ConfigureApiBehaviorOptions(options => @@ -188,6 +185,8 @@ namespace TeacherExt public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + string basePath = this.Configuration.GetValue("BasePath", $"/{Assembly.GetEntryAssembly().GetName().Name}"); + app.UsePathBase(basePath); app.UseSwagger(); app.UseSwaggerUI(c => { diff --git a/labs/Teacher/TeacherExt/TeacherExt.csproj b/labs/Teacher/TeacherExt/TeacherExt.csproj index 4e3c1ac2..1b2520e4 100644 --- a/labs/Teacher/TeacherExt/TeacherExt.csproj +++ b/labs/Teacher/TeacherExt/TeacherExt.csproj @@ -5,7 +5,7 @@ true en true - 1.0.0.0-beta.10 + 1.0.0.0-rc.4 13a75881-1072-47ca-88e9-4d78bd678d65 diff --git a/labs/Teacher/TeacherExt/Views/Shared/_Layout.cshtml b/labs/Teacher/TeacherExt/Views/Shared/_Layout.cshtml index 57a79998..6dcd2be8 100644 --- a/labs/Teacher/TeacherExt/Views/Shared/_Layout.cshtml +++ b/labs/Teacher/TeacherExt/Views/Shared/_Layout.cshtml @@ -108,6 +108,7 @@ + diff --git a/labs/Teacher/TeacherExt/appsettings.json b/labs/Teacher/TeacherExt/appsettings.json index d77a3e9e..916553e4 100644 --- a/labs/Teacher/TeacherExt/appsettings.json +++ b/labs/Teacher/TeacherExt/appsettings.json @@ -7,6 +7,7 @@ } }, "server.urls": "http://*:8081", + "BasePath": "/profile_ext", "AllowedHosts": "*", "database": "sqlite", "jwt": { diff --git a/labs/Teacher/TeacherExt/wwwroot/js/site.js b/labs/Teacher/TeacherExt/wwwroot/js/site.js index a5dded1e..581ece02 100644 --- a/labs/Teacher/TeacherExt/wwwroot/js/site.js +++ b/labs/Teacher/TeacherExt/wwwroot/js/site.js @@ -147,11 +147,16 @@ function InitControls() { // if ($.datetimepicker) { $.datetimepicker.setLocale('zh'); - $('.edit-date').datetimepicker({ - closeOnDateSelect:true, - timepicker: false, format: 'Y-m-d', - onChangeDateTime: function (dp, $input) { - $($input).valid(); + $('.edit-date').each(function () { + var picker = $(this).datetimepicker({ + closeOnDateSelect: true, + timepicker: false, format: 'Y-m-d', + onChangeDateTime: function (dp, $input) { + $($input).valid(); + } + }); + if ($(this).val()) { + $(this).val(moment($(this).datetimepicker('getValue')).format("YYYY-MM-DD")); } }); $('.edit-datetime').datetimepicker({ format: 'Y-m-d H:i' }); diff --git a/labs/Teacher/account.txt b/labs/Teacher/account.txt index f13e672c..19aee0ad 100644 --- a/labs/Teacher/account.txt +++ b/labs/Teacher/account.txt @@ -24,7 +24,7 @@ vpn下载&服务器地址:https://125.72.102.82:44331 Web:10.10.15.12 root DsIdeal@123 /usr/local/openresty/nginx/sbin/nginx - /usr/local/openresty/nginx/conf/nginx.conf +/usr/local/openresty/nginx/conf/nginx.conf 数据库: 10.10.15.13:22066 root DsideaL147258369