1. 密碼 bug fix

2. 固定地圖總覽
This commit is contained in:
Kai 2021-08-19 12:07:57 +08:00
parent 3bfb4ba11b
commit c6a9d9653b
7 changed files with 104 additions and 50 deletions

View File

@ -202,11 +202,33 @@ namespace SolarPower.Controllers
"CreatedBy",
};
await roleRepository.AddAsync(role, properties);
var id = await roleRepository.AddOneAsync(role, properties);
#endregion
#region ()
List<RoleAuth> roleAuths = new List<RoleAuth>();
RoleAuth roleAuth = new RoleAuth();
roleAuth.Id = role.Id;
roleAuth.AuthCode = "A";
roleAuth.CreatedBy = myUser.Id;
roleAuths.Add(roleAuth);
List<string> roleAuth_properties = new List<string>()
{
"Id",
"AuthCode",
"CreatedBy",
};
await roleRepository.AddRoleAuthAsync(roleAuths, roleAuth_properties);
#endregion
apiResult.Code = "0000";
apiResult.Msg = "儲存成功";
#endregion
}
else
{

View File

@ -174,7 +174,6 @@ namespace SolarPower.Controllers
{
"Password",
"UpdatedBy",
"UpdatedAt",
"Id"
};
@ -186,6 +185,7 @@ namespace SolarPower.Controllers
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = errorCode.GetString(apiResult.Code);
string json = System.Text.Json.JsonSerializer.Serialize(post);
Logger.LogError("【" + controllerName + "/" + actionName + "】");
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);

View File

@ -312,7 +312,7 @@
"info": true,
"autoWidth": false,
"responsive": true,
"order": [[1, "desc"]],
// "order": [[1, "desc"]],
"columns": [{
"data": "authCode"
}, {
@ -329,9 +329,13 @@
'className': 'dt-body-center',
'render': function (data, type, full, meta) {
var check_html = "";
var disabled = "";
check_html += '<div class="custom-control custom-checkbox">';
if (full.checkAuth > 0) {
check_html += '<input type="checkbox" class="custom-control-input" name="selectedAuthPage[]" id="auth-page-' + data + '" value="' + data + '" checked /> ';
if (data == 'A') {
disabled = "disabled";
}
check_html += '<input type="checkbox" class="custom-control-input" name="selectedAuthPage[]" id="auth-page-' + data + '" value="' + data + '" checked ' + disabled + ' /> ';
} else {
check_html += '<input type="checkbox" class="custom-control-input" name="selectedAuthPage[]" id="auth-page-' + data + '" value="' + data + '" /> ';
}

View File

@ -7,22 +7,34 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>後台管理 | 忘記密碼</title>
<title>忘記密碼 | 太陽能電站管理系統</title>
<!-- base css -->
<link id="vendorsbundle" rel="stylesheet" media="screen, print" href="~/css/vendors.bundle.css">
<link id="appbundle" rel="stylesheet" media="screen, print" href="~/css/app.bundle.css">
<link id="mytheme" rel="stylesheet" media="screen, print" href="~/css/themes/cust-theme-15.css">
<link id="myskin" rel="stylesheet" media="screen, print" href="~/css/skins/skin-master.css">
<!-- Place favicon.ico in the root directory -->
<link rel="apple-touch-icon" sizes="180x180" href="~/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="~/img/favicon/favicon-32x32.png">
<link rel="mask-icon" href="~/img/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="stylesheet" media="screen, print" href="~/css/page-login-alt.css">
<!-- Font Awesome -->
<link href="~/lib/fontawesome-free/css/all.min.css" rel="stylesheet" />
<!-- icheck bootstrap -->
<link href="~/lib/icheck-bootstrap/icheck-bootstrap.min.css" rel="stylesheet" />
<!-- AdminLTE -->
<link href="~/css/adminlte.min.css" rel="stylesheet" />
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="../../index2.html" class="h1"><b>Admin</b>LTE</a>
<body>
<div class="blankpage-form-field">
<div class="page-logo m-0 w-100 align-items-center justify-content-center rounded border-bottom-left-radius-0 border-bottom-right-radius-0 px-4">
<a href="javascript:void(0)" class="page-logo-link press-scale-down d-flex align-items-center">
<img src="~/img/logo.png" alt="SmartAdmin WebApp" aria-roledescription="logo">
<span class="page-logo-text mr-1">太陽能電站管理系統</span>
<i class="fal fa-angle-down d-inline-block ml-1 fs-lg color-primary-300"></i>
</a>
</div>
<div class="card-body">
<p class="login-box-msg">忘記密碼</p>
<div class="card p-4 border-top-left-radius-0 border-top-right-radius-0">
@if (ViewBag.ErrMsg != null && ViewBag.ErrMsg != "")
{
<p class="alert alert-danger">@ViewBag.ErrMsg</p>
@ -41,24 +53,30 @@
</div>
<div class="row">
<div class="col-12">
<button type="submit" class="btn btn-primary btn-block">取得新密碼</button>
<button type="submit" class="btn btn-default float-right">取得新密碼</button>
</div>
<!-- /.col -->
</div>
</form>
<p class="mt-3 mb-1">
<a href="/Login/Index">登入</a>
</p>
</div>
<!-- /.login-card-body -->
<div class="blankpage-footer text-center">
<a asp-controller="Login" asp-action="Index"><strong>返回登入</strong></a>
</div>
</div>
<!-- /.login-box -->
<video poster="~/img/backgrounds/clouds.png" id="bgvid" playsinline autoplay muted loop>
<source src="~/media/video/cc.webm" type="video/webm">
<source src="~/media/video/cc.mp4" type="video/mp4">
</video>
<!-- jQuery -->
<script src="~/lib/jquery/dist/jquery.js"></script>
<!-- Bootstrap 4 -->
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="~/js/adminlte.min.js"></script>
@*<script src="~/js/adminlte.min.js"></script>*@
<script src="~/js/vendors.bundle.js"></script>
<script src="~/js/app.bundle.js"></script>
</body>
</html>

View File

@ -67,7 +67,7 @@
</form>
</div>
<div class="blankpage-footer text-center">
<a href="#"><strong>忘記密碼</strong></a> | <a href="#"><strong>申請帳號</strong></a>
<a asp-controller="Login" asp-action="ForgotPassword"><strong>忘記密碼</strong></a> | <a href="#"><strong>申請帳號</strong></a>
</div>
</div>

View File

@ -350,6 +350,16 @@
"createdCell": function (td, cellData, rowData, row, col) {
$(td).html(row + 1)
}
}, {
'targets': 7,
'searchable': false,
'orderable': false,
'className': 'dt-body-center',
"createdCell": function (td, cellData, rowData, row, col) {
if (rowData.authCode == 'A') {
$(td).html("");
}
}
}],
"language": {
"emptyTable": "查無資料",
@ -411,7 +421,7 @@
"autoWidth": false,
"responsive": false,
"deferLoading": 0,
"order": [[1, "desc"]],
// "order": [[1, "desc"]],
"columns": [{
"data": "authCode"
}, {

View File

@ -77,7 +77,7 @@ function SavePersonalInfo() {
//#region 變更密碼表單驗證
$(function () {
jQuery.validator.addMethod("pwcheck", function (value, element) {
var xxx = /^[A-Za-z0-9\d=!\-@._*]*$/.test(value);
var xxx = /^[A-Za-z0-9\d=!@#$%^&+=]*$/.test(value);
return xxx;// consists of only these
//&& /[a-z]/.test(value) // has a lowercase letter
//&& /\d/.test(value) // has a digit
@ -103,10 +103,10 @@ $(function () {
},
messages: {
new_password_modal: {
pwcheck: "密碼格式錯誤"
pwcheck: "密碼格式錯誤,格式需為大小寫英文或數字或特殊符號【!@#$%^&+=】"
},
again_password_modal: {
pwcheck: "密碼格式錯誤",
pwcheck: "密碼格式錯誤,格式需為大小寫英文或數字或特殊符號【!@#$%^&+=】",
equalTo: "兩次密碼輸入不同"
}
}