Former-commit-id: 56fab78ae3a30195505764f2cb07153af1ced096
Former-commit-id: 467363f5c3950d371a2750d61816ab380e9a66ad
1.0
wanggang 5 years ago
parent ad2051eb40
commit 3513ec87e5

@ -2,6 +2,7 @@
using Infrastructure.Extensions;
using Infrastructure.Web;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Rendering;
@ -156,16 +157,27 @@ namespace TeacherExt.Controllers
}
[HttpGet]
public IActionResult Update(int id)
public IActionResult Update(int id,string access_token)
{
var person = this._personRepo.ReadOnlyTable().Where(o => o.Id == id).FirstOrDefault();
var organ = this._organizationRepo.ReadOnlyTable().Where(o => o.Id == person.OrganId).FirstOrDefault();
var model = person.To<EditTeacherModel>();
model.OrganName = organ.Name;
this.EntityToModel(person, model);
this.ToEditModel(person, model);
model.LoginName = this._loginRepo.ReadOnlyTable().Where(o => o.PersonId == model.Id).Select(o => o.LoginName).FirstOrDefault();
if(!string.IsNullOrEmpty(access_token))
{
var httpContext = this.Request.HttpContext;
var token = access_token;
var cookieOptions = new CookieOptions
{
HttpOnly = true
};
var cookieName = httpContext.GetJwtCookieName();
httpContext.Response.Cookies.Delete(cookieName);
httpContext.Response.Cookies.Append(cookieName, token, cookieOptions);
}
return Result<EditTeacherModel>(model);
}

@ -5,7 +5,7 @@
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<GenerateAssemblyProductAttribute>true</GenerateAssemblyProductAttribute>
<Version>0.5.0.0</Version>
<Version>0.6.0.0</Version>
<UserSecretsId>13a75881-1072-47ca-88e9-4d78bd678d65</UserSecretsId>
</PropertyGroup>
@ -20,6 +20,9 @@
<None Update="install.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="start.sh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="test.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

@ -12,6 +12,10 @@
<div class="card-body">
<div class="row">
@Html.AntiForgeryToken()
@if (Context.Request.Query.ContainsKey("iframe")||(Context.Request.Method=="POST"&&Context.Request.Form.ContainsKey("iframe")))
{
@Html.Hidden("iframe","")
}
<div class="col-sm-12">
<div class="form-group row">
<div class="col-sm-2 col-form-label"></div>
@ -172,6 +176,7 @@
<script>
function submit(msg, func) {
Swal.fire({
position:'bottom',
text: msg,
confirmButtonText: '确定',
cancelButtonText: '取消',

@ -14,6 +14,7 @@
<link rel="stylesheet" href="~/lib/sweetalert2/dist/sweetalert2.min.css" />
<link rel="stylesheet" href="~/lib/jquery-datetimepicker/jquery.datetimepicker.min.css" />
<link rel="stylesheet" href="~/lib/sweetalert2/dist/sweetalert2.min.css" />
<link rel="stylesheet" href="~/lib/sweetalert2/themes/minimal/minimal.css" />
<link rel="stylesheet" href="~/lib/select2/css/select2.min.css" />
<link rel="stylesheet" href="~/lib/select2/dist/select2-bootstrap4.min.css" />
<link rel="stylesheet" href="~/lib/kindeditor/themes/default/default.css" />
@ -23,7 +24,7 @@
@RenderSection("styles", required: false)
</head>
<body class="hold-transition layout-top-nav text-sm">
@if (Context.Request.Query.ContainsKey("iframe"))
@if (Context.Request.Query.ContainsKey("iframe")||(Context.Request.Method=="POST"&&Context.Request.Form.ContainsKey("iframe")))
{
@RenderBody()
}

@ -5,7 +5,7 @@ mysqldump -uroot -pDsideaL147258369 dsideal_db t_base_person>/root/t_base_person
mysql -uroot -pDsideaL147258369 dsideal_db<update.sql
nano /etc/rc.d/rc.local
cd /root/publish && ./TeacherExt
/root/publish/start.sh>null &
部署测试:

@ -148,6 +148,12 @@
"destination": "wwwroot/lib/sweetalert2",
"files": [ "dist/sweetalert2.all.min.js", "dist/sweetalert2.min.css" ]
},
{
"provider": "unpkg",
"library": "@sweetalert2/themes@4.0.2",
"destination": "wwwroot/lib/sweetalert2/themes",
"files": ["minimal/minimal.css"]
},
{
"provider": "unpkg",
"library": "senna@2.7.9",

@ -0,0 +1,2 @@
#!/bin/bash
cd /root/publish && ./TeacherExt

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save