-
+
@@ -21,6 +21,11 @@ export default {
cachedViews() {
return this.$store.state.tagsView.cachedViews
},
+ // cachedViews 为空时勿传 []:Vue2 keep-alive 的 include 为 [] 会匹配不到任何组件,部分环境下首屏空白
+ keepAliveInclude() {
+ const list = this.cachedViews
+ return list && list.length ? list : undefined
+ },
key() {
return this.$route.path
}
diff --git a/src/permission.js b/src/permission.js
index b4ede2b..39f2b73 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -58,6 +58,11 @@ router.beforeEach((to, from, next) => {
}
})
-router.afterEach(() => {
+router.afterEach((to) => {
NProgress.done()
+ // 移动端不渲染 TagsView,其 watch 里的 addTags 不会执行,cachedViews 一直为空。
+ // AppMain 中 keep-alive 的 include 依赖 cachedViews,空数组时部分页面(如闲鱼商品)首进可能白屏,需刷新才正常。
+ if (to.name) {
+ store.dispatch('tagsView/addView', to)
+ }
})
diff --git a/src/views/system/erpProduct/index.vue b/src/views/system/erpProduct/index.vue
index 621ec48..0c4e280 100644
--- a/src/views/system/erpProduct/index.vue
+++ b/src/views/system/erpProduct/index.vue
@@ -423,7 +423,11 @@ export default {
if (this.erpAccountList.length > 0 && !this.queryParams.appid) {
this.queryParams.appid = this.erpAccountList[0].value;
this.getList();
+ } else if (!this.queryParams.appid) {
+ this.loading = false;
}
+ }).catch(() => {
+ this.loading = false;
});
},
/** 加载会员名列表 */
diff --git a/src/views/system/social-media/prompt-config.vue b/src/views/system/social-media/prompt-config.vue
index af4ba45..4a4eb3b 100644
--- a/src/views/system/social-media/prompt-config.vue
+++ b/src/views/system/social-media/prompt-config.vue
@@ -112,12 +112,16 @@
- 大模型接入配置
+ 大模型接入配置(多套 · 激活一套生效)
+
+ 新增配置
+ 刷新
+
-
说明:与上方提示词相同,配置写入 Redis,由 Jarvis 读取。可在「本地 Ollama」与「OpenAI 兼容 HTTP」之间切换。
+
说明:可保存多套(如本地 Ollama、远程 API),在表格中点击激活后,Jarvis 社媒 AI 仅使用当前激活的一套。未激活或清空全部时走 Jarvis 默认 Ollama。
- - Ollama:填写根地址(如
http://127.0.0.1:11434),可不填则使用 Jarvis 默认;模型名可空则使用 yml 默认。
- - OpenAI 兼容:填写完整 Chat Completions URL(如远程
https://api.xxx.com/v1/chat/completions 或本地 http://127.0.0.1:11434/v1/chat/completions),并填写模型名;密钥无则留空(部分本地服务不需要)。
+ - Ollama:根地址可空(用 Jarvis 默认),模型可空。
+ - OpenAI 兼容:须填完整 Chat Completions URL 与模型名;密钥可空。
-
-
-
- 本地 Ollama
- OpenAI 兼容接口
-
-
-
-
-
-
-
-
-
-
- 当前已保存密钥:{{ llmApiKeyMasked || '****' }}
-
-
- 清除已保存的 API 密钥
-
-
- 保存接入配置
- 重新加载
- 恢复默认(清除 Redis 中的接入配置)
-
-
+
+
+ 当前 Jarvis 使用:
+ {{ llmActiveName || llmSummary.activeId }}
+
+
+ 未激活
+ 将使用 Jarvis yml 默认 Ollama
+
+
+
+
+
+
+ {{ scope.row.mode === 'openai' ? 'OpenAI兼容' : 'Ollama' }}
+
+
+
+
+
+
+ {{ scope.row.hasApiKey ? (scope.row.apiKeyMasked || '已设') : '—' }}
+
+
+
+
+ 使用中
+ —
+
+
+
+
+ 激活
+ 编辑
+ 删除
+
+
+
+
+ 取消激活
+ 清空全部配置
+
+
+
+
+
+
+
+
+
+ Ollama
+ OpenAI 兼容
+
+
+
+
+
+
+
+
+
+
+ 已保存:{{ llmApiKeyMasked || '****' }}
+
+
+ 清除已保存的密钥
+
+
+
+