修改logo

This commit is contained in:
dev02 2023-01-04 18:38:36 +08:00
parent b213464345
commit 2533649eda
7 changed files with 69 additions and 53 deletions

View File

@ -44,7 +44,7 @@
<div class="col-auto"> <a href="#" class="btn btn-info" id="acc_searchBtn">搜尋</a> </div>
</div>
<div class="frame-wrap">
<div class="mb-3">
<div class="mb-3" hidden>
<a href="#" class="btn btn-success" data-toggle="modal"
data-target="#accManModal">+ 新增</a>
</div>
@ -127,7 +127,7 @@
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="inpAcc">帳號</label>
<input type="text" id="inpAcc" name="inpAcc" class="form-control">
<input type="text" id="inpAcc" name="inpAcc" class="form-control" disabled>
</div>
</div>
<div class="col-md-6">
@ -253,15 +253,7 @@
<script>
var rolAuthTable = null;
$(function () {
asyncUser();
clearPagSes();
getRoleSel();
loadAccManTable();
loadRolManTable();
loadAuthPageTable();
loadRolAuthTable();
setAuthPage();
events();
asyncUser(initCallBack);
})
function loadAccManTable() {
@ -346,7 +338,7 @@
}
let sendData = {};
sendData.Layer = 0;
sendData.Layer = 1;
if (pageAct.rolName != null)
sendData.Full_name = pageAct.rolName;
@ -546,6 +538,7 @@
let url = baseApiUrl + "/User/RoleManagerList";
let sendData = {
post: 1,
Layer: 1
};
objSendData.Data = sendData;
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
@ -906,7 +899,18 @@
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
}
function asyncUser() {
function initCallBack() {
clearPagSes();
getRoleSel();
loadAccManTable();
loadRolManTable();
loadAuthPageTable();
loadRolAuthTable();
setAuthPage();
events();
}
function asyncUser() {
getUserByBaja(syncUsrCallBack)
}
@ -914,7 +918,9 @@
let url = baseApiUrl + "/User/SyncUser";
var data = JSON.parse(rel);
objSendData.Data = data.data;
console.log(objSendData);
ytAjax = new YourTeam.Ajax(url, objSendData, null, null, "POST").send();
}
ytAjax = new YourTeam.Ajax(url, objSendData, function () {
initCallBack();
}, null, "POST").send();
}
</script>

View File

@ -2782,14 +2782,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
}
function getLogo() {
$.ajax({
method: "post",
url: 'api/GetLogo',
async: false,
success: function (rel) {
$('[name=webLogo]').attr('src', 'img/' + rel);
}
})
url = baseApiUrl + '/api/GetLogo',
ytAjax = new YourTeam.Ajax(url, null, function (res) {
$('[name=webLogo]').attr('src', 'img/' + res.data);
}, null, "POST").send();
}
</script>

View File

@ -248,7 +248,7 @@
function getLogo() {
$.ajax({
method: "post",
url: 'api/GetLogo',
url: baseApiUrl + '/api/GetLogo',
async: false,
success: function (rel) {
$('[name=webLogo]').attr('src', 'img/' + rel);

View File

@ -10,6 +10,7 @@ using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using Repository.BackendRepository.Interface;
using Repository.FrontendRepository.Interface;
using Serilog.Core;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
@ -136,5 +137,28 @@ namespace FrontendWebApi.ApiControllers
return Ok(apiResult);
}
[HttpPost]
[Route("api/GetLogo")]
public async Task<ApiResult<string>> GetLogo()
{
ApiResult<string> apiResult = new ApiResult<string>();
try
{
var sqlString = $@"select system_value from variable where system_type = 'logo'";
var data = await backendRepository.GetOneAsync<string>(sqlString);
apiResult.Code = "0000";
apiResult.Data = data;
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
logger.LogError("【Login/Index】" + exception.Message);
}
return apiResult;
}
}
}

View File

@ -155,28 +155,5 @@ namespace FrontendWebApi.ApiControllers
return apiResult;
}
[HttpPost]
[Route("api/GetLogo")]
public async Task<ApiResult<string>> GetLogo()
{
ApiResult<string> apiResult = new ApiResult<string>();
try
{
var sqlString = $@"select system_type from variable where system_type = 'logo'";
var data = await backendRepository.GetOneAsync<string>(sqlString);
apiResult.Code = "0000";
apiResult.Data = data;
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
}
}

View File

@ -9,6 +9,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Transactions;
using Repository.Models;
using System.Data.SqlTypes;
namespace Repository.BackendRepository.Implement
{
@ -262,11 +263,18 @@ namespace Repository.BackendRepository.Implement
foreach (var data in result2)
{
sb2.Append($@"INSERT device_kind (device_kind_guid, device_building_tag, device_system_tag, device_name_tag,
device_normal_flashing, device_close_flashing, device_error_flashing, device_error_independent,
created_by, created_at)
VALUES (uuid(), '" + data.device_building_tag + "', '" + data.device_system_tag + "', '" + data.device_name_tag +
"', 0, 0, 1, 0, 'B43E3CA7-96DD-4FC7-B6E6-974ACC3B0878', now());");
var sqlString = new StringBuilder();
sqlString.Append("select * from device_kind where device_building_tag = '" + data.device_building_tag + "' and device_system_tag = '" + data.device_system_tag + "' and device_name_tag = '" + data.device_name_tag + "'");
var dk = (await conn.QueryAsync<device_kind>(sqlString.ToString())).ToList<device_kind>();
if (dk.Count == 0)
{
sb2.Append($@"INSERT device_kind (device_kind_guid, device_building_tag, device_system_tag, device_name_tag,
device_normal_flashing, device_close_flashing, device_error_flashing, device_error_independent,
created_by, created_at)
VALUES (uuid(), '" + data.device_building_tag + "', '" + data.device_system_tag + "', '" + data.device_name_tag +
"', 0, 0, 1, 0, 'B43E3CA7-96DD-4FC7-B6E6-974ACC3B0878', now());");
}
}
if (sb.Length > 0)

View File

@ -102,4 +102,9 @@ namespace Repository.Models
public string device_system_tag { get; set; }
public string device_name_tag { get; set; }
}
public class device_kind
{
public string device_kind_guid { get; set; }
}
}