mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
feat: 优化移动端响应式设计
- 优化所有页面的移动端适配(手机、平板、PC) - 修复AccountsView移动端状态显示和按钮功能问题 - 修复ApiKeysView移动端详情展开显示问题 - 移除ApiKeysView不必要的查看按钮 - 修复Dashboard页面PC版时间筛选按钮布局 - 改进所有组件的响应式设计 - 删除dist目录避免构建文件冲突 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -56,21 +56,25 @@ const authenticateApiKey = async (req, res, next) => {
|
||||
let clientAllowed = false;
|
||||
let matchedClient = null;
|
||||
|
||||
// 获取预定义客户端列表,如果配置不存在则使用默认值
|
||||
const predefinedClients = config.clientRestrictions?.predefinedClients || [];
|
||||
const allowCustomClients = config.clientRestrictions?.allowCustomClients || false;
|
||||
|
||||
// 遍历允许的客户端列表
|
||||
for (const allowedClientId of validation.keyData.allowedClients) {
|
||||
// 在预定义客户端列表中查找
|
||||
const predefinedClient = config.clientRestrictions.predefinedClients.find(
|
||||
const predefinedClient = predefinedClients.find(
|
||||
client => client.id === allowedClientId
|
||||
);
|
||||
|
||||
if (predefinedClient) {
|
||||
// 使用预定义的正则表达式匹配 User-Agent
|
||||
if (predefinedClient.userAgentPattern.test(userAgent)) {
|
||||
if (predefinedClient.userAgentPattern && predefinedClient.userAgentPattern.test(userAgent)) {
|
||||
clientAllowed = true;
|
||||
matchedClient = predefinedClient.name;
|
||||
break;
|
||||
}
|
||||
} else if (config.clientRestrictions.allowCustomClients) {
|
||||
} else if (allowCustomClients) {
|
||||
// 如果允许自定义客户端,这里可以添加自定义客户端的验证逻辑
|
||||
// 目前暂时跳过自定义客户端
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user