chore: update migration version and add migration logic for version 147

- Incremented migration version from 146 to 147.
- Implemented migration logic to trim trailing slashes from the apiHost of the anthropic provider.
This commit is contained in:
suyao 2025-09-03 23:19:40 +08:00
parent 5aa8f3901f
commit 63c7dcc0d5
No known key found for this signature in database
2 changed files with 16 additions and 1 deletions

View File

@ -67,7 +67,7 @@ const persistedReducer = persistReducer(
{
key: 'cherry-studio',
storage,
version: 146,
version: 147,
blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs'],
migrate
},

View File

@ -2368,6 +2368,21 @@ const migrateConfig = {
logger.error('migrate 146 error', error as Error)
return state
}
},
'147': (state: RootState) => {
try {
state.llm.providers.forEach((provider) => {
if (provider.id === SystemProviderIds.anthropic) {
if (provider.apiHost.endsWith('/')) {
provider.apiHost = provider.apiHost.slice(0, -1)
}
}
})
return state
} catch (error) {
logger.error('migrate 147 error', error as Error)
return state
}
}
}