diff --git a/.env.development b/.env.development
index eab18b8..87d96d9 100644
--- a/.env.development
+++ b/.env.development
@@ -1,3 +1,14 @@
# 开发环境配置
# 留空则通过 vite proxy 代理到 http://101.133.172.2:8082
VITE_API_BASE_URL=
+
+# ===== mineru_ai_chat 智能问答(iframe 免登集成) =====
+# 问答服务地址(本地调试指向本机后端;上线改为 http://192.168.16.49:8081)
+VITE_AI_CHAT_BASE=http://localhost:8081
+# 问答页面前端地址(iframe 加载用;本地开发是 Vite 5173,生产留空即与 BASE 同源)
+VITE_AI_CHAT_WEB=http://localhost:5173
+# 免登密钥,须与 mineru 后端 SSO_SECRET 一致。
+# 注意:本密钥会随前端打包暴露,后端已做安全边界——该通道仅能开通 viewer
+# (普通问答访客)账号,无法冒充 editor/admin 等特权账号。
+VITE_AI_CHAT_SECRET=yunsan-sso-dev-secret
+VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)
diff --git a/.env.production b/.env.production
index e39a3c3..1b9c14f 100644
--- a/.env.production
+++ b/.env.production
@@ -1,2 +1,10 @@
# 生产环境配置(直连实际地址,需包含应用 context path)
VITE_API_BASE_URL=http://10.104.10.151:8888/juntech-ysdp
+
+# ===== mineru_ai_chat 智能问答(iframe 免登集成) =====
+VITE_AI_CHAT_BASE=http://192.168.16.49:8081
+# 生产问答页面与后端同源(8081 托管构建产物),留空即可
+VITE_AI_CHAT_WEB=
+# 上线前改为正式密钥(与 mineru 容器 SSO_SECRET 一致);通道仅能开通 viewer 账号
+VITE_AI_CHAT_SECRET=
+VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)
diff --git a/src/components/AiChatFloat.vue b/src/components/AiChatFloat.vue
new file mode 100644
index 0000000..18e6570
--- /dev/null
+++ b/src/components/AiChatFloat.vue
@@ -0,0 +1,258 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/router/index.js b/src/router/index.js
index d3637a8..5d44f96 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -49,6 +49,12 @@ const routes = [
],
meta: { requiresAuth: true }
},
+ {
+ path: '/aichat',
+ name: 'AiChat',
+ component: () => import('@/views/aichat/index.vue'),
+ meta: { title: '智能问答', requiresAuth: true }
+ },
{
path: '/404',
name: '404',
diff --git a/src/utils/aiChat.js b/src/utils/aiChat.js
new file mode 100644
index 0000000..7023279
--- /dev/null
+++ b/src/utils/aiChat.js
@@ -0,0 +1,23 @@
+// AI 问答服务地址解析(aichat 整页与悬浮窗组件共用)
+// env 里可能配成 localhost/127.0.0.1:局域网其他机器访问时,localhost 指向的是
+// 访问者自己的电脑,必然连不上。这里在运行时把 localhost 替换为当前页面的
+// host(IP 或域名),端口保持不变;配置的本来就是 IP/域名则原样使用。
+function resolveAiUrl(raw) {
+ if (!raw) return ''
+ try {
+ const u = new URL(raw, window.location.href)
+ if (u.hostname === 'localhost' || u.hostname === '127.0.0.1') {
+ u.hostname = window.location.hostname
+ }
+ return u.origin + u.pathname.replace(/\/$/, '')
+ } catch (e) {
+ return raw
+ }
+}
+
+// mineru_ai_chat 服务地址与免登密钥(.env 配置,勿走 request.js —— 避开 SM4 加密拦截器)
+// AI_BASE:后端 API 地址;AI_WEB:问答页面前端地址(iframe 用,留空即与 BASE 同源)
+export const AI_BASE = resolveAiUrl(import.meta.env.VITE_AI_CHAT_BASE || 'http://localhost:8081')
+export const AI_WEB = resolveAiUrl(import.meta.env.VITE_AI_CHAT_WEB || AI_BASE)
+export const AI_SECRET = import.meta.env.VITE_AI_CHAT_SECRET || ''
+export const AI_TITLE = import.meta.env.VITE_AI_CHAT_TITLE || 'AI问答(快速查询应急方案)'
diff --git a/src/views/aichat/index.vue b/src/views/aichat/index.vue
new file mode 100644
index 0000000..5ce9c9b
--- /dev/null
+++ b/src/views/aichat/index.vue
@@ -0,0 +1,140 @@
+
+
+
+ ← 返回首页
+ 智能问答
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 3ff8265..ca4feff 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -25,10 +25,14 @@
+
+
+