diff --git a/src/App.vue b/src/App.vue
index b856c61..748d2cb 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -43,7 +43,7 @@
-
+
@@ -35,7 +35,7 @@
+
\ No newline at end of file
diff --git a/src/stores/settings.ts b/src/stores/settings.ts
index a5bb3a6..6863ff3 100644
--- a/src/stores/settings.ts
+++ b/src/stores/settings.ts
@@ -4,6 +4,10 @@ import type { AppSettings } from '../types'
const STORAGE_KEY = 'ai-trade-settings'
+/** 额外关键字默认:规定 AI 角色与分析能力 */
+export const DEFAULT_KEYWORDS =
+ '你是一名专业的国内期货交易员和分析员,精通机构操盘手法,能够根据持仓与交易数据分析当前走势。'
+
function load(): Partial {
try {
return JSON.parse(localStorage.getItem(STORAGE_KEY) || '{}') as Partial
@@ -15,7 +19,7 @@ function load(): Partial {
export const useSettingsStore = defineStore('settings', () => {
const saved = load()
const apiKey = ref(saved.apiKey || '')
- const keywords = ref(saved.keywords || '')
+ const keywords = ref(saved.keywords || DEFAULT_KEYWORDS)
watch([apiKey, keywords], () => {
const payload: AppSettings = {
@@ -23,7 +27,7 @@ export const useSettingsStore = defineStore('settings', () => {
keywords: keywords.value,
}
localStorage.setItem(STORAGE_KEY, JSON.stringify(payload))
- })
+ }, { immediate: true })
return { apiKey, keywords }
})