9999
100100</div >
101101
102+ ### 8. 闪抽界面
103+ <div class =" config-card " >
104+
105+ - ** URL** : ` secrandom://direct_extraction `
106+ - ** 功能** : 打开闪抽界面,快速进行抽取操作,并会在设定的时间后自动关闭。(关闭时间可在设置中进行调整)
107+
108+ ** 使用场景** :
109+ - 需要快速完成单次抽取操作
110+ - 课堂或会议中进行快速随机选择
111+ - 活动中需要短时间内完成抽取并自动结束
112+
113+ </div >
114+
102115## 带Action参数的URL
103116
104117### 抽人相关操作
@@ -183,6 +196,21 @@ start secrandom://reward?action=stop
183196
184197</div >
185198
199+ ### 闪抽相关操作
200+ <div class =" config-card highlight " >
201+
202+ #### 使用闪抽
203+ - ** URL** : ` secrandom://direct_extraction `
204+ - ** 功能** : 自动切换到闪抽界面并开始抽取操作,当到达设定时间会自动关闭。
205+
206+ ** 使用示例** :
207+ ``` batch
208+ # 批处理文件示例
209+ start secrandom://direct_extraction
210+ ```
211+
212+ </div >
213+
186214## 💡 URL协议使用指南
187215
188216<div class =" tip-box " >
@@ -260,6 +288,10 @@ class SecRandomController:
260288 """ 打开设置界面"""
261289 os.system(f " start { self .base_url} settings " )
262290
291+ def open_direct_extraction (self ):
292+ """ 使用闪抽"""
293+ os.system(f " start { self .base_url} direct_extraction " )
294+
263295# 使用示例
264296controller = SecRandomController()
265297controller.open_main()
@@ -300,6 +332,16 @@ class SecRandomController {
300332 });
301333 });
302334 }
335+
336+ async openDirectExtraction () {
337+ // 使用闪抽
338+ return new Promise ((resolve , reject ) => {
339+ exec (` start ${ this .baseUrl } direct_extraction` , (error ) => {
340+ if (error) reject (error);
341+ else resolve ();
342+ });
343+ });
344+ }
303345}
304346
305347// 使用示例
@@ -351,6 +393,16 @@ class SecRandomController
351393 UseShellExecute = true
352394 });
353395 }
396+
397+ public void OpenDirectExtraction ()
398+ {
399+ // 使用闪抽
400+ Process .Start (new ProcessStartInfo
401+ {
402+ FileName = BaseUrl + " direct_extraction" ,
403+ UseShellExecute = true
404+ });
405+ }
354406}
355407
356408// 使用示例
@@ -389,6 +441,23 @@ class SecRandomController {
389441 e. printStackTrace();
390442 }
391443 }
444+
445+ public void openSettings () {
446+ try {
447+ Desktop . getDesktop(). browse(new URI (BASE_URL + " settings" ));
448+ } catch (Exception e) {
449+ e. printStackTrace();
450+ }
451+ }
452+
453+ public void openDirectExtraction () {
454+ // 使用闪抽
455+ try {
456+ Desktop . getDesktop(). browse(new URI (BASE_URL + " direct_extraction" ));
457+ } catch (Exception e) {
458+ e. printStackTrace();
459+ }
460+ }
392461}
393462
394463// 使用示例
@@ -498,6 +567,11 @@ timeout /t 2 >nul
498567
499568echo 5. 打开设置界面
500569start secrandom://settings
570+ timeout /t 2 >nul
571+
572+ echo 6. 使用闪抽
573+ start secrandom://direct_extraction
574+ timeout /t 2 >nul
501575
502576echo 演示完成!
503577pause
@@ -526,6 +600,7 @@ function Invoke-SecRandom {
526600Invoke-SecRandom -Action "main"
527601Invoke-SecRandom -Action "pumping" -Parameters "action=start"
528602Invoke-SecRandom -Action "settings"
603+ Invoke-SecRandom -Action "direct_extraction"
529604```
530605
531606#### Web 应用集成
@@ -534,6 +609,7 @@ Invoke-SecRandom -Action "settings"
534609<button onclick =" openSecRandom('main')" >打开SecRandom</button >
535610<button onclick =" startPumping()" >开始抽人</button >
536611<button onclick =" stopPumping()" >停止抽人</button >
612+ <button onclick =" openDirectExtraction()" >使用闪抽</button >
537613
538614<script >
539615function openSecRandom (action , params = ' ' ) {
@@ -548,6 +624,11 @@ function startPumping() {
548624function stopPumping () {
549625 openSecRandom (' pumping' , ' action=stop' );
550626}
627+
628+ function openDirectExtraction () {
629+ // 使用闪抽
630+ openSecRandom (' direct_extraction' );
631+ }
551632 </script >
552633```
553634
0 commit comments