tmp
This commit is contained in:
@@ -97,6 +97,11 @@ export default class WebSocketServerManager {
|
||||
return;
|
||||
}
|
||||
if (msg.agent === 'escort-admin') {
|
||||
// 管理端 agent 含写库/环境变量等高危工具,必须校验管理员角色,防止普通用户越权
|
||||
if (!userInfo.app || !("wxapp-escort-admin" in userInfo.app)) {
|
||||
ws.send(JSON.stringify({ type: 'error', content: '无管理员权限' }));
|
||||
return;
|
||||
}
|
||||
await adminAgent.streamChat(userInfo, [msg], (source, type, content, id) => {
|
||||
send(source, type, content, id);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user