From 027b126f879b2f0818b57bd7f88c615915c30321 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sun, 8 Mar 2026 14:37:24 +0000
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=A2=E9=98=9F=E7=99=BB=E5=BD=95?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=BC=80=E5=8F=91?=
=?UTF-8?q?=E8=80=85=E7=BC=96=E5=8F=B7=E8=BE=93=E5=85=A5=EF=BC=88DEV-XXX?=
=?UTF-8?q?=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
---
docs/index.html | 82 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 75 insertions(+), 7 deletions(-)
diff --git a/docs/index.html b/docs/index.html
index 392f13f3..898f6ade 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -354,7 +354,7 @@ footer{padding:12px 18px 16px;padding-bottom:max(16px,env(safe-area-inset-bottom
-
+
+
+
+ 输入你的开发者编号(格式:DEV-XXX),系统将自动录入
+
@@ -751,6 +757,9 @@ const ROLE_MAP = {
'Awen': {role:'dev', title:'通知中心开发', emoji:'💻', badgeCls:'rb-dev', devId:'DEV-012'},
};
+// Custom dev ID format validation (DEV-001, DEV-013, etc.)
+const DEV_ID_RE = /^DEV-\d{3,}$/;
+
// Known API endpoints for fallback auto-detect (when user doesn't provide endpoint)
const KNOWN_ENDPOINTS = [
{label:'云雾 AI', base:'https://api.yunwu.ai/v1'},
@@ -1370,14 +1379,53 @@ function doDemo(){
showApp();
}
+function onTeamSelectChange(){
+ var sel = document.getElementById('tuid').value;
+ var customBox = document.getElementById('team-custom-input');
+ if(sel==='__custom__'){
+ customBox.style.display='';
+ document.getElementById('tcustom-id').value='';
+ document.getElementById('tcustom-id').focus();
+ } else {
+ customBox.style.display='none';
+ }
+ updateTeamIdPreview();
+}
+
function updateTeamIdPreview(){
- const un = document.getElementById('tuid').value;
- const el = document.getElementById('team-id-preview');
- if(!un||!el) return;
- const meta = ROLE_MAP[un];
+ var sel = document.getElementById('tuid').value;
+ var el = document.getElementById('team-id-preview');
+ if(!el) return;
+
+ // Custom dev ID input mode
+ if(sel==='__custom__'){
+ var raw = (document.getElementById('tcustom-id').value||'').trim().toUpperCase();
+ if(!raw){
+ el.innerHTML = ''
+ + '✏️ 请输入你的开发者编号(格式:DEV-XXX)'
+ + '
';
+ return;
+ }
+ // Validate format
+ if(DEV_ID_RE.test(raw)){
+ el.innerHTML = ''
+ + '💻 '+esc(raw)+' · 自定义开发者'
+ + '
✅ 使用服务器端 API 代理 · 128k 上下文 · 首次登录将自动注册'
+ + '
';
+ } else {
+ el.innerHTML = ''
+ + '⚠️ 编号格式不正确,请使用 DEV-XXX 格式(如 DEV-013)'
+ + '
';
+ }
+ return;
+ }
+
+ // Normal dropdown selection mode
+ if(!sel){ el.innerHTML=''; return; }
+ var meta = ROLE_MAP[sel];
if(meta){
el.innerHTML = ''
- + meta.emoji+' '+esc(un)+' · '+meta.title
+ + meta.emoji+' '+esc(sel)+' · '+meta.title
+ (meta.devId ? ' · '+meta.devId+'' : '')
+ '
✅ 使用服务器端 API 代理 · 128k 上下文 · 无需密钥'
+ '
';
@@ -1387,7 +1435,23 @@ function updateTeamIdPreview(){
}
function doTeamLogin(){
- const un = document.getElementById('tuid').value;
+ var sel = document.getElementById('tuid').value;
+ var un = sel;
+
+ // Handle custom dev ID
+ if(sel==='__custom__'){
+ var raw = (document.getElementById('tcustom-id').value||'').trim().toUpperCase();
+ if(!raw){
+ alert('请输入你的开发者编号(格式:DEV-XXX)');
+ return;
+ }
+ if(!DEV_ID_RE.test(raw)){
+ alert('开发者编号格式不正确,请使用 DEV-XXX 格式(如 DEV-013)');
+ return;
+ }
+ un = raw;
+ }
+
if(!un){
alert('请选择你的开发者身份');
return;
@@ -2186,6 +2250,10 @@ function setIdentity(userName, ghUser){
A.userName = userName||'';
A.ghUser = ghUser||'';
A.userMeta = userName ? (ROLE_MAP[userName]||null) : null;
+ // Fallback metadata for custom dev IDs (DEV-XXX not in ROLE_MAP)
+ if(!A.userMeta && userName && DEV_ID_RE.test(userName)){
+ A.userMeta = {role:'dev', title:'开发者', emoji:'💻', badgeCls:'rb-dev', devId:userName};
+ }
A.role = A.userMeta?.role || 'guest';
lss('zy_uname', A.userName);
lss('zy_ghuser', A.ghUser);