deepv-code 1.0.288 → 1.0.289
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/bundle/assets/help/cli-help-knowledge.md +22 -0
- package/bundle/dvcode.js +806 -790
- package/bundle/login/templates/authSelectPage.html +180 -2
- package/package.json +1 -1
|
@@ -131,6 +131,26 @@
|
|
|
131
131
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
.vipcard-btn {
|
|
135
|
+
background: #ffffff;
|
|
136
|
+
color: #374151;
|
|
137
|
+
border: 2px solid #e5e7eb;
|
|
138
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.vipcard-btn:hover {
|
|
142
|
+
background: #f9fafb;
|
|
143
|
+
border-color: #f59e0b;
|
|
144
|
+
color: #d97706;
|
|
145
|
+
transform: translateY(-1px);
|
|
146
|
+
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.vipcard-btn:active {
|
|
150
|
+
transform: translateY(0);
|
|
151
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
152
|
+
}
|
|
153
|
+
|
|
134
154
|
.icon {
|
|
135
155
|
width: 22px;
|
|
136
156
|
height: 22px;
|
|
@@ -359,6 +379,27 @@
|
|
|
359
379
|
box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
|
|
360
380
|
}
|
|
361
381
|
|
|
382
|
+
/* VIP卡表单特殊样式 */
|
|
383
|
+
.vipcard-form .form-group input:focus {
|
|
384
|
+
border-color: #f59e0b;
|
|
385
|
+
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.vipcard-form .btn-primary {
|
|
389
|
+
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.vipcard-form .btn-primary:hover:not(:disabled) {
|
|
393
|
+
background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.vipcard-hint {
|
|
397
|
+
font-size: 12px;
|
|
398
|
+
color: #9ca3af;
|
|
399
|
+
margin-top: 8px;
|
|
400
|
+
text-align: left;
|
|
401
|
+
}
|
|
402
|
+
|
|
362
403
|
.form-actions {
|
|
363
404
|
display: flex;
|
|
364
405
|
gap: 12px;
|
|
@@ -495,6 +536,11 @@
|
|
|
495
536
|
<span data-i18n="auth.cheetah.button">Cheetah OA Login</span>
|
|
496
537
|
</button>
|
|
497
538
|
|
|
539
|
+
<button id="vipcard-btn" class="auth-button vipcard-btn" onclick="startVipCardAuth()">
|
|
540
|
+
<span class="icon" style="font-size: 20px;">🎫</span>
|
|
541
|
+
<span data-i18n="auth.vipcard.button">VIP Card Login</span>
|
|
542
|
+
</button>
|
|
543
|
+
|
|
498
544
|
<!-- 猎豹OA登录表单 -->
|
|
499
545
|
<div id="cheetah-form" class="cheetah-form hidden">
|
|
500
546
|
<h3 data-i18n="auth.cheetah.form.title">Cheetah OA Login</h3>
|
|
@@ -513,6 +559,22 @@
|
|
|
513
559
|
</div>
|
|
514
560
|
</form>
|
|
515
561
|
</div>
|
|
562
|
+
|
|
563
|
+
<!-- VIP卡登录表单 -->
|
|
564
|
+
<div id="vipcard-form" class="cheetah-form vipcard-form hidden">
|
|
565
|
+
<h3 data-i18n="auth.vipcard.form.title">VIP Card Activation & Login</h3>
|
|
566
|
+
<form id="vipcard-login-form" onsubmit="submitVipCardAuth(event)">
|
|
567
|
+
<div class="form-group">
|
|
568
|
+
<label for="vipcard-code" data-i18n="auth.vipcard.form.code">Redemption Code:</label>
|
|
569
|
+
<input type="text" id="vipcard-code" name="code" required placeholder="VIP-XXXXXXXX" style="text-transform: uppercase;" />
|
|
570
|
+
<div class="vipcard-hint" data-i18n="auth.vipcard.form.hint">Enter the code from your VIP card</div>
|
|
571
|
+
</div>
|
|
572
|
+
<div class="form-actions">
|
|
573
|
+
<button type="button" class="btn-secondary" onclick="cancelVipCardAuth()" data-i18n="auth.vipcard.form.cancel">Cancel</button>
|
|
574
|
+
<button type="submit" class="btn-primary" data-i18n="auth.vipcard.form.submit">Activate & Login</button>
|
|
575
|
+
</div>
|
|
576
|
+
</form>
|
|
577
|
+
</div>
|
|
516
578
|
</div>
|
|
517
579
|
|
|
518
580
|
<div class="description" data-i18n="auth.page.instruction">
|
|
@@ -554,7 +616,18 @@
|
|
|
554
616
|
'auth.message.error.connection.content': 'Unable to connect to authentication server. Please check your network connection and try again.',
|
|
555
617
|
'auth.message.error.connection.button': 'Retry',
|
|
556
618
|
'auth.message.error.feishu.content': 'Unable to start Feishu authentication. Please check your network connection and try again.',
|
|
557
|
-
'auth.message.error.deepvlab.content': 'Unable to start DeepVlab authentication. Please check your network connection and try again.'
|
|
619
|
+
'auth.message.error.deepvlab.content': 'Unable to start DeepVlab authentication. Please check your network connection and try again.',
|
|
620
|
+
'auth.vipcard.button': 'VIP Card Login',
|
|
621
|
+
'auth.vipcard.form.title': 'VIP Card Activation & Login',
|
|
622
|
+
'auth.vipcard.form.code': 'Redemption Code',
|
|
623
|
+
'auth.vipcard.form.hint': 'Enter the code from your VIP card',
|
|
624
|
+
'auth.vipcard.form.cancel': 'Cancel',
|
|
625
|
+
'auth.vipcard.form.submit': 'Activate & Login',
|
|
626
|
+
'auth.vipcard.form.submitting': 'Processing...',
|
|
627
|
+
'auth.vipcard.success.title': 'Activation Successful!',
|
|
628
|
+
'auth.vipcard.success.content': 'Your VIP card has been activated and you are now logged in. You can close this window and continue using DeepV Code.',
|
|
629
|
+
'auth.vipcard.error.empty': 'Please enter the redemption code.',
|
|
630
|
+
'auth.vipcard.error.invalid': 'Invalid or expired redemption code. Please check and try again.'
|
|
558
631
|
},
|
|
559
632
|
zh: {
|
|
560
633
|
'auth.page.title': '选择认证方式',
|
|
@@ -587,7 +660,18 @@
|
|
|
587
660
|
'auth.message.error.connection.content': '无法连接到认证服务器。请检查您的网络连接并重试。',
|
|
588
661
|
'auth.message.error.connection.button': '重试',
|
|
589
662
|
'auth.message.error.feishu.content': '无法启动飞书认证。请检查您的网络连接并重试。',
|
|
590
|
-
'auth.message.error.deepvlab.content': '无法启动DeepVlab认证。请检查您的网络连接并重试。'
|
|
663
|
+
'auth.message.error.deepvlab.content': '无法启动DeepVlab认证。请检查您的网络连接并重试。',
|
|
664
|
+
'auth.vipcard.button': 'VIP卡登录',
|
|
665
|
+
'auth.vipcard.form.title': 'VIP卡激活与登录',
|
|
666
|
+
'auth.vipcard.form.code': '兑换码',
|
|
667
|
+
'auth.vipcard.form.hint': '请输入VIP卡上的兑换码',
|
|
668
|
+
'auth.vipcard.form.cancel': '取消',
|
|
669
|
+
'auth.vipcard.form.submit': '激活并登录',
|
|
670
|
+
'auth.vipcard.form.submitting': '处理中...',
|
|
671
|
+
'auth.vipcard.success.title': '激活成功!',
|
|
672
|
+
'auth.vipcard.success.content': '您的VIP卡已激活并完成登录。现在可以关闭此窗口并继续使用DeepV Code。',
|
|
673
|
+
'auth.vipcard.error.empty': '请输入兑换码。',
|
|
674
|
+
'auth.vipcard.error.invalid': '兑换码无效或已过期,请检查后重试。'
|
|
591
675
|
}
|
|
592
676
|
};
|
|
593
677
|
|
|
@@ -915,6 +999,100 @@
|
|
|
915
999
|
}
|
|
916
1000
|
});
|
|
917
1001
|
}
|
|
1002
|
+
|
|
1003
|
+
function startVipCardAuth() {
|
|
1004
|
+
console.log('显示VIP卡登录表单...');
|
|
1005
|
+
// 隐藏所有认证按钮
|
|
1006
|
+
const buttons = document.querySelectorAll('.auth-button');
|
|
1007
|
+
buttons.forEach(btn => btn.style.display = 'none');
|
|
1008
|
+
|
|
1009
|
+
// 显示VIP卡表单
|
|
1010
|
+
const form = document.getElementById('vipcard-form');
|
|
1011
|
+
if (form) {
|
|
1012
|
+
form.classList.remove('hidden');
|
|
1013
|
+
// 聚焦到输入框
|
|
1014
|
+
const codeInput = document.getElementById('vipcard-code');
|
|
1015
|
+
if (codeInput) {
|
|
1016
|
+
codeInput.focus();
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
function cancelVipCardAuth() {
|
|
1022
|
+
console.log('取消VIP卡登录...');
|
|
1023
|
+
// 隐藏表单
|
|
1024
|
+
const form = document.getElementById('vipcard-form');
|
|
1025
|
+
if (form) {
|
|
1026
|
+
form.classList.add('hidden');
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
// 清空输入
|
|
1030
|
+
const codeInput = document.getElementById('vipcard-code');
|
|
1031
|
+
if (codeInput) {
|
|
1032
|
+
codeInput.value = '';
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// 显示所有认证按钮
|
|
1036
|
+
const buttons = document.querySelectorAll('.auth-button');
|
|
1037
|
+
buttons.forEach(btn => btn.style.display = 'flex');
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
function submitVipCardAuth(event) {
|
|
1041
|
+
event.preventDefault();
|
|
1042
|
+
console.log('提交VIP卡登录...');
|
|
1043
|
+
|
|
1044
|
+
const codeInput = document.getElementById('vipcard-code');
|
|
1045
|
+
const code = codeInput ? codeInput.value.trim().toUpperCase() : '';
|
|
1046
|
+
|
|
1047
|
+
if (!code) {
|
|
1048
|
+
showMessage('error', t('auth.message.error.input.title'), t('auth.vipcard.error.empty'), t('auth.message.error.input.button'));
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
// 禁用提交按钮
|
|
1053
|
+
const submitBtn = event.target.querySelector('button[type="submit"]');
|
|
1054
|
+
const cancelBtn = event.target.querySelector('button[type="button"]');
|
|
1055
|
+
if (submitBtn) {
|
|
1056
|
+
submitBtn.disabled = true;
|
|
1057
|
+
submitBtn.textContent = t('auth.vipcard.form.submitting');
|
|
1058
|
+
}
|
|
1059
|
+
if (cancelBtn) {
|
|
1060
|
+
cancelBtn.disabled = true;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
fetch('/start-vipcard-auth', {
|
|
1064
|
+
method: 'POST',
|
|
1065
|
+
headers: {
|
|
1066
|
+
'Content-Type': 'application/json',
|
|
1067
|
+
},
|
|
1068
|
+
body: JSON.stringify({ code })
|
|
1069
|
+
})
|
|
1070
|
+
.then(response => response.json())
|
|
1071
|
+
.then(data => {
|
|
1072
|
+
if (data.success) {
|
|
1073
|
+
// 登录成功,显示成功消息(不允许关闭)
|
|
1074
|
+
showMessage('success', t('auth.vipcard.success.title'), t('auth.vipcard.success.content'), t('auth.message.success.button'), { closable: false });
|
|
1075
|
+
// 隐藏表单,显示按钮
|
|
1076
|
+
cancelVipCardAuth();
|
|
1077
|
+
} else {
|
|
1078
|
+
showMessage('error', t('auth.message.error.login.title'), data.message || t('auth.vipcard.error.invalid'), t('auth.message.error.login.button'));
|
|
1079
|
+
}
|
|
1080
|
+
})
|
|
1081
|
+
.catch(error => {
|
|
1082
|
+
console.error('VIP卡登录失败:', error);
|
|
1083
|
+
showMessage('error', t('auth.message.error.connection.title'), t('auth.message.error.connection.content'), t('auth.message.error.connection.button'));
|
|
1084
|
+
})
|
|
1085
|
+
.finally(() => {
|
|
1086
|
+
// 恢复提交按钮
|
|
1087
|
+
if (submitBtn) {
|
|
1088
|
+
submitBtn.disabled = false;
|
|
1089
|
+
submitBtn.textContent = t('auth.vipcard.form.submit');
|
|
1090
|
+
}
|
|
1091
|
+
if (cancelBtn) {
|
|
1092
|
+
cancelBtn.disabled = false;
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
918
1096
|
</script>
|
|
919
1097
|
</body>
|
|
920
1098
|
</html>
|