feat(search): 添加AI推荐功能并优化相关逻辑

This commit is contained in:
PKC278
2026-01-15 03:04:58 +08:00
parent 30a10eaf6d
commit be40f55bd9
21 changed files with 2175 additions and 1952 deletions

View File

@@ -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