liuq hace 2 semanas
padre
commit
2320e13951
Se han modificado 1 ficheros con 33 adiciones y 0 borrados
  1. 33 0
      templates/attachment_test/index.html

+ 33 - 0
templates/attachment_test/index.html

@@ -52,6 +52,30 @@
         word-break: break-all;
         margin-top: 8px;
     }
+    .attachment-ua-footer {
+        margin-top: 28px;
+        padding-top: 20px;
+        border-top: 1px solid #e8e8e8;
+    }
+    .attachment-ua-label {
+        font-size: 0.85em;
+        color: #888;
+        margin-bottom: 8px;
+    }
+    .attachment-ua-text {
+        margin: 0;
+        padding: 12px 14px;
+        background: #f4f6f8;
+        border-radius: 8px;
+        font-size: 0.75em;
+        line-height: 1.45;
+        color: #444;
+        white-space: pre-wrap;
+        word-break: break-all;
+        font-family: ui-monospace, Consolas, monospace;
+        max-height: 200px;
+        overflow-y: auto;
+    }
 </style>
 {% endblock %}
 
@@ -86,6 +110,11 @@
             <button type="button" class="btn btn-secondary" id="btnDelete">删除</button>
         </div>
         <div id="urlBox" class="attachment-url-box" style="display: none;"></div>
+
+        <div class="attachment-ua-footer" id="uaFooter" aria-label="浏览器标识">
+            <div class="attachment-ua-label">浏览器 User-Agent</div>
+            <pre id="userAgentText" class="attachment-ua-text"></pre>
+        </div>
     </div>
 {% endblock %}
 
@@ -100,6 +129,10 @@
     const previewActions = document.getElementById('previewActions');
     const urlBox = document.getElementById('urlBox');
     const uniappHint = document.getElementById('uniappHint');
+    const userAgentText = document.getElementById('userAgentText');
+    if (userAgentText) {
+        userAgentText.textContent = navigator.userAgent || '(不可用)';
+    }
 
     function useUniNative() {
         return window.imSDK && typeof imSDK.isUniAppIm === 'function' && imSDK.isUniAppIm();