diff --git a/Backend/Startup.cs b/Backend/Startup.cs index 53a99f0..7285fc6 100644 --- a/Backend/Startup.cs +++ b/Backend/Startup.cs @@ -24,6 +24,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; using System.Text; using System.IdentityModel.Tokens.Jwt; +using Microsoft.AspNetCore.Http; namespace Backend { @@ -159,7 +160,13 @@ namespace Backend app.UseSession(); app.UseHttpsRedirection(); - app.UseStaticFiles(); + app.UseStaticFiles(new StaticFileOptions + { + OnPrepareResponse = ctx => + { + ctx.Context.Response.Headers.Append("Access-Control-Allow-Origin", "*"); + } + }); app.UseRouting(); JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index 1f537fb..800c867 100644 --- a/Frontend/_sysMonAll.html +++ b/Frontend/_sysMonAll.html @@ -110,48 +110,47 @@ return strHtml; } - function drawInfoTabBlo() { - let strHtml = `
設備編號 | -B01-B2-19F-CR-001 | -3D 座標 | -113 | -
設備名稱 | -A區迴路001 | -forge dbid | -101 | -
廠牌 | -飛利浦 Philip | -IP | -192.168.1.105 | -
型號 | -BH065 | -- | - |
原廠文件 | -2022使用手冊.pdf | -- | - |
型號 | -BH065 | -- | - |
"); + td.text(colName); + tr.append(td); + tbody.append(tr); + }) + + let url = baseApiUrl + "/api/Device/GetBaseDevice"; + let sendData = { + device_guid: devGuid, + }; + objSendData.Data = sendData; + ytAjax = new YourTeam.Ajax(url, objSendData, function (res) { + if (!res || res.code != "0000" || !res.data) { + + } else { + tbody.find("tr").eq(0).append(creEle("td", res.data.device_number)); + tbody.find("tr").eq(1).append(creEle("td", res.data.full_name)); + } + }, null, "POST").send(); + + //let strHtml = ` |
設備編號 | + //B01-B2-19F-CR-001 | + //
設備名稱 | + //A區迴路001 | + + //