瀏覽代碼

[frontend] Update app

Dima 1 年之前
父節點
當前提交
d4452c534e
共有 3 個文件被更改,包括 6 次插入2 次删除
  1. 0 0
      web/public/assets/index-a1413657.js
  2. 1 1
      web/public/index.html
  3. 5 1
      web/src/client/client.js

File diff suppressed because it is too large
+ 0 - 0
web/public/assets/index-a1413657.js


+ 1 - 1
web/public/index.html

@@ -6,7 +6,7 @@
     <title>Homethings</title>
     <link rel="icon" href="/assets/favicon-ef41fc5b.ico">
     
-  <script type="module" crossorigin src="/assets/index-7dfe232a.js"></script>
+  <script type="module" crossorigin src="/assets/index-a1413657.js"></script>
   <link rel="stylesheet" href="/assets/index-7639778d.css">
 </head>
 <body>

+ 5 - 1
web/src/client/client.js

@@ -56,7 +56,11 @@ export const routeUpdateNotification = "/api/v1/things/notifications/{thingId}"
 export const routeDeleteNotification = "/api/v1/things/notifications/{thingId}"
 
 export function getHost() {
-    return window.location.protocol + "//" + window.location.hostname + ":" + serverPort;
+    if (window.location.hostname === "localhost") {
+        return window.location.protocol + "//" + window.location.hostname + ":" + serverPort;
+    }
+
+    return window.location.protocol + "//" + window.location.hostname;
 }
 
 export function jsonRequest(method, url, data) {

Some files were not shown because too many files changed in this diff