mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 21:01:32 +08:00
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:
parent
5aa8f3901f
commit
63c7dcc0d5
@ -67,7 +67,7 @@ const persistedReducer = persistReducer(
|
||||
{
|
||||
key: 'cherry-studio',
|
||||
storage,
|
||||
version: 146,
|
||||
version: 147,
|
||||
blacklist: ['runtime', 'messages', 'messageBlocks', 'tabs'],
|
||||
migrate
|
||||
},
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user