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:
copilot-swe-agent[bot] 2026-04-08 00:59:23 +00:00 committed by GitHub
parent 3b0a2294f8
commit c326187af6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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();