mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix: 修复apikeys页面部分bug
This commit is contained in:
@@ -1021,8 +1021,7 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 自动加载账号数据
|
||||
await refreshAccounts()
|
||||
// 使用缓存的账号数据,不自动刷新(用户可点击"刷新账号"按钮手动刷新)
|
||||
})
|
||||
|
||||
// 刷新账号列表
|
||||
|
||||
@@ -1233,8 +1233,7 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 自动加载账号数据
|
||||
await refreshAccounts()
|
||||
// 使用缓存的账号数据,不自动刷新(用户可点击"刷新账号"按钮手动刷新)
|
||||
|
||||
form.name = props.apiKey.name
|
||||
|
||||
@@ -1271,11 +1270,16 @@ onMounted(async () => {
|
||||
form.restrictedModels = props.apiKey.restrictedModels || []
|
||||
form.allowedClients = props.apiKey.allowedClients || []
|
||||
form.tags = props.apiKey.tags || []
|
||||
// 从后端数据中获取实际的启用状态,而不是根据数组长度推断
|
||||
form.enableModelRestriction = props.apiKey.enableModelRestriction || false
|
||||
form.enableClientRestriction = props.apiKey.enableClientRestriction || false
|
||||
// 初始化活跃状态,默认为 true
|
||||
form.isActive = props.apiKey.isActive !== undefined ? props.apiKey.isActive : true
|
||||
// 从后端数据中获取实际的启用状态,强制转换为布尔值(Redis返回的是字符串)
|
||||
form.enableModelRestriction =
|
||||
props.apiKey.enableModelRestriction === true || props.apiKey.enableModelRestriction === 'true'
|
||||
form.enableClientRestriction =
|
||||
props.apiKey.enableClientRestriction === true || props.apiKey.enableClientRestriction === 'true'
|
||||
// 初始化活跃状态,默认为 true(强制转换为布尔值,因为Redis返回字符串)
|
||||
form.isActive =
|
||||
props.apiKey.isActive === undefined ||
|
||||
props.apiKey.isActive === true ||
|
||||
props.apiKey.isActive === 'true'
|
||||
|
||||
// 初始化所有者
|
||||
form.ownerId = props.apiKey.userId || 'admin'
|
||||
|
||||
Reference in New Issue
Block a user