示例代码块

测试代码块语言显示

这是一个测试,右上角应该显示代码语言。


[Proxy]
# 无线网卡。在 MacBook Pro 上,无线网卡的接口名一定是 en0
Wi-Fi = direct, interface=en0, test-url=http://connectivitycheck.platform.hicloud.com/generate_204
# 需要根据 ifconfig 自己判断。而且,Thunderbolt 自带的网卡 和 通过 Thunderbolt 的 PCIE 转接的网卡 的接口名也不一样
Thunderbolt = direct, interface=en10, test-url=http://connectivitycheck.platform.hicloud.com/generate_204
# 国内测速地址如前文所说,可以按需选择。这里是因为将 direct 作为一个特殊的 Proxy Policy、所以需要手动指定测速地址、否则 Surge 会使用 `proxt-test-url` 来测活

[Proxy Group]
# 新建一个策略组 Domestic,使用 fallback、每 30 秒测活一次
# 这个策略组还同时包含了 Surge 内置的 DIRECT 策略、即由 macOS 系统决定的当前活跃的网络接口(也就是 Surge 的 Primary Interface Changed 中的 Primary Interface)
Domestic = fallback, Thunderbolt, Wi-Fi, DIRECT, interval=30, timeout=3
# 如果策略组使用 load-balance,还可以实现多网卡负载均衡和叠加、适合下载没有限制 IP 的大文件
Domestic Dual = load-balance, Thunderbolt, Wi-Fi, interval=30, timeout=3

效果没有调整到最佳,有机会再继续调整

其他mermaid展示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
flowchart TD
%% 1) 用户首次进入到APP & 前端检测到未鉴权
subgraph 用户 & 前端
Enter[前端] --> CheckLocal{本地判断<br/>auth_time<br/>过期}
CheckLocal --> |未过期| FE[用户与大模型常规对话]
CheckLocal --> |已过期| FE_Reset[前端调接口<br/>重置 auth_status=100<br/>清空 auth_time]
FE_Reset --> FE
FE --> LLM
end

subgraph Database
TBL[(auth_status / auth_time)]
FE_Reset --> TBL
end

%% 2) 大模型识别下单
subgraph 大模型
LLM[大模型识别到下单] -->|需要鉴权| MCP[MCP鉴权工具]
end

%% 3) MCP 鉴权工具
subgraph MCP鉴权工具
MCP --> MCP_Query{查询表\n当前状态?}
MCP_Query -->|300\n且未过期| MCP_Succ[直接返回鉴权成功]
MCP_Query -->|200| MCP_MsgOnly[返回tool msg\n“鉴权中”] --> MCP_Wait[阻塞监听表\n等待 300/400]
MCP_Query -->|100| MCP_Set200[置表=200\n返回tool msg]
MCP_Set200 --> MCP_Wait
MCP_Wait --> MCP_Result[返回鉴权结果]
end

%% 4) 前端弹窗
subgraph 前端弹窗
Poll[流式结束轮询] --> Cond{查到状态?}
Cond -->|100| NoAct1[无动作]
Cond -->|300 & auth_time未过期| NoAct2[无动作]
Cond -->|200| Pwd[弹交易密码框]
Pwd --> UserInput[用户输入密码]
UserInput --> FE_Set[前端调接口\n置表=300/400\n写 auth_time]
FE_Set --> TBL
end

%% 连线
MCP_Query -.-> TBL
MCP_Set200 --> TBL
MCP_Wait -.轮询/阻塞.-> TBL
MCP_Succ --> LLM
MCP_MsgOnly --> LLM
MCP_Result --> LLM
LLM --> FE
作者

JIeJaitt

发布于

2024-07-07

更新于

2025-01-22

许可协议

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×