fix: 修复专属账号下拉框,仅显示dedicated类型账号

- 修改CreateApiKeyModal和EditApiKeyModal的过滤逻辑
- 专属账号下拉框只显示accountType='dedicated'的账号
- 移除accountType='group'的账号,这些账号通过分组调度
- 更新标签文字为'专属账号'以更准确描述
This commit is contained in:
shaw
2025-08-03 22:25:06 +08:00
parent 9c9afe1528
commit a5c7eeaf84
8 changed files with 497 additions and 35 deletions

View File

@@ -0,0 +1,52 @@
/**
* 检查 Redis 中的所有键
*/
const redis = require('../src/models/redis');
async function checkRedisKeys() {
console.log('🔍 检查 Redis 中的所有键...\n');
try {
// 确保 Redis 已连接
await redis.connect();
// 获取所有键
const allKeys = await redis.client.keys('*');
console.log(`找到 ${allKeys.length} 个键\n`);
// 按类型分组
const keysByType = {};
allKeys.forEach(key => {
const prefix = key.split(':')[0];
if (!keysByType[prefix]) {
keysByType[prefix] = [];
}
keysByType[prefix].push(key);
});
// 显示各类型的键
Object.keys(keysByType).sort().forEach(type => {
console.log(`\n📁 ${type}: ${keysByType[type].length}`);
// 显示前 5 个键作为示例
const keysToShow = keysByType[type].slice(0, 5);
keysToShow.forEach(key => {
console.log(` - ${key}`);
});
if (keysByType[type].length > 5) {
console.log(` ... 还有 ${keysByType[type].length - 5}`);
}
});
} catch (error) {
console.error('❌ 错误:', error);
console.error(error.stack);
} finally {
process.exit(0);
}
}
checkRedisKeys();