mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-12 03:01:54 +08:00
feat(search): 添加AI推荐功能并优化相关逻辑
This commit is contained in:
@@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
|
||||
import type { globalSettingsState } from '@/stores/types'
|
||||
import { fetchGlobalSettings } from '@/utils/globalSetting'
|
||||
import { useVersionChecker } from '@/composables/useVersionChecker'
|
||||
import api from '@/api'
|
||||
|
||||
export const useGlobalSettingsStore = defineStore('globalSettings', {
|
||||
state: (): globalSettingsState => ({
|
||||
@@ -32,6 +33,19 @@ export const useGlobalSettingsStore = defineStore('globalSettings', {
|
||||
}
|
||||
},
|
||||
|
||||
// 登录后加载用户相关设置
|
||||
async loadUserSettings() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/global/user')
|
||||
if (result.success && result.data) {
|
||||
// 合并用户设置到现有数据
|
||||
this.data = { ...this.data, ...result.data }
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load user settings', error)
|
||||
}
|
||||
},
|
||||
|
||||
setData(data: { [key: string]: any }) {
|
||||
this.data = data
|
||||
this.initialized = true
|
||||
|
||||
Reference in New Issue
Block a user