fix: dashboard verification code buttons unresponsive - template literal regex escaping broke JS
The regex `/\\/dashboard\\/[a-f0-9]+$/` inside a template literal produced `//dashboard/[a-f0-9]+$/` in the browser (JS comment), breaking all function definitions. Replaced with indexOf/substring approach to avoid template literal escape issues entirely. Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/c6b1f183-6fbc-4cee-b903-ce22d94e2f81 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
3b0a2294f8
commit
c326187af6
|
|
@ -890,7 +890,8 @@ mode: direct
|
|||
<script>
|
||||
// 动态计算API基路径: 通过nginx代理时页面在 /api/proxy-v3/dashboard/{token},
|
||||
// 直接访问时在 /dashboard/{token},需要提取 /dashboard/ 之前的前缀作为API路径基座
|
||||
var bwBasePath = window.location.pathname.replace(/\/dashboard\/[a-f0-9]+$/, '');
|
||||
var dashIdx = window.location.pathname.indexOf('/dashboard/');
|
||||
var bwBasePath = dashIdx >= 0 ? window.location.pathname.substring(0, dashIdx) : '';
|
||||
|
||||
function bwSendCode() {
|
||||
var email = document.getElementById('bwEmail').value.trim().toLowerCase();
|
||||
|
|
|
|||
Loading…
Reference in New Issue