feat: add new stores for cron, locale, providers, script, shared data, skills, and user info
- Implemented `cron` store to manage scheduled tasks with CRUD operations. - Created `locale` store for language settings with persistence and system language detection. - Added `providers` store to handle provider accounts and configurations with API interactions. - Developed `script` store for managing automation scripts, including recording and execution. - Introduced `sharedStore` for managing shared data across components. - Established `skills` store for fetching, installing, and managing skills from a marketplace. - Created `userinfo` store for user authentication and session management. chore: update path aliases from `@store` to `@stores` in TypeScript configuration and Vite config
This commit is contained in:
25
src/stores/sharedStore.ts
Normal file
25
src/stores/sharedStore.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { isEqual } from 'lodash-es'
|
||||
|
||||
export const useSharedStore = defineStore('shared', {
|
||||
state: () => ({
|
||||
sharedData: {},
|
||||
}),
|
||||
|
||||
actions: {
|
||||
updateSharedData(data: any) {
|
||||
this.sharedData = Object.assign(this.sharedData, data)
|
||||
|
||||
const cloneData = JSON.parse(JSON.stringify(this.sharedData))
|
||||
|
||||
if (!isEqual(this.sharedData, data)) {
|
||||
// 同步状态到主进程
|
||||
try {
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user