refactor: 将 RuoYi 标记替换为 HZHub
This commit is contained in:
39
hzhub-portal-company/.build/plugins/index.ts
Normal file
39
hzhub-portal-company/.build/plugins/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { ConfigEnv, PluginOption } from 'vite';
|
||||
import path from 'node:path';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import UnoCSS from 'unocss/vite';
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import envTyped from 'vite-plugin-env-typed';
|
||||
import createSvgIcon from './svg-icon';
|
||||
|
||||
const root = path.resolve(__dirname, '../../');
|
||||
|
||||
function plugins({ mode, command }: ConfigEnv): PluginOption[] {
|
||||
return [
|
||||
UnoCSS(),
|
||||
envTyped({
|
||||
mode,
|
||||
envDir: root,
|
||||
envPrefix: 'VITE_',
|
||||
filePath: path.join(root, 'types', 'import_meta.d.ts'),
|
||||
}),
|
||||
vue(),
|
||||
AutoImport({
|
||||
imports: ['vue'],
|
||||
eslintrc: {
|
||||
enabled: true,
|
||||
},
|
||||
resolvers: [ElementPlusResolver()],
|
||||
dts: path.join(root, 'types', 'auto-imports.d.ts'),
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
dts: path.join(root, 'types', 'components.d.ts'),
|
||||
}),
|
||||
createSvgIcon(command === 'build'),
|
||||
];
|
||||
}
|
||||
|
||||
export default plugins;
|
||||
21
hzhub-portal-company/.build/plugins/svg-icon.ts
Normal file
21
hzhub-portal-company/.build/plugins/svg-icon.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import path from 'node:path';
|
||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
|
||||
|
||||
const root = path.resolve(__dirname, '../../');
|
||||
|
||||
export default function createSvgIcon(isBuild: boolean) {
|
||||
return createSvgIconsPlugin({
|
||||
iconDirs: [
|
||||
path.join(root, 'src/assets/icons/svg'),
|
||||
path.join(root, 'src/assets/icons/Buildings'),
|
||||
path.join(root, 'src/assets/icons/Business'),
|
||||
path.join(root, 'src/assets/icons/Device'),
|
||||
path.join(root, 'src/assets/icons/Document'),
|
||||
path.join(root, 'src/assets/icons/Others'),
|
||||
path.join(root, 'src/assets/icons/System'),
|
||||
path.join(root, 'src/assets/icons/User'),
|
||||
],
|
||||
symbolId: 'icon-[dir]-[name]',
|
||||
svgoOptions: isBuild,
|
||||
});
|
||||
}
|
||||
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Project Overview
|
||||
|
||||
This is **ruoyi-web**, a Vue 3 AI chat application built with TypeScript, Vite, and Element Plus. It provides a chat interface for AI interactions with support for sessions, models, and various authentication methods.
|
||||
This is **hzhub-portal**, a Vue 3 AI chat application built with TypeScript, Vite, and Element Plus. It provides a chat interface for AI interactions with support for sessions, models, and various authentication methods.
|
||||
|
||||
## Commands
|
||||
|
||||
|
||||
47
hzhub-portal-company/Dockerfile
Normal file
47
hzhub-portal-company/Dockerfile
Normal file
@@ -0,0 +1,47 @@
|
||||
# 构建阶段
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
# 接收构建参数
|
||||
ARG VITE_API_URL
|
||||
ARG VITE_APP_ENV=production
|
||||
|
||||
# 设置环境变量
|
||||
ENV VITE_API_URL=${VITE_API_URL}
|
||||
ENV VITE_APP_ENV=${VITE_APP_ENV}
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制 package 文件
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# 安装 pnpm 并安装依赖
|
||||
RUN npm install -g pnpm && \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
# 复制源代码
|
||||
COPY . .
|
||||
|
||||
# 构建生产版本(使用 production 模式)
|
||||
RUN pnpm build
|
||||
|
||||
# 生产阶段
|
||||
FROM nginx:alpine
|
||||
|
||||
# 安装 envsubst
|
||||
RUN apk add --no-cache gettext
|
||||
|
||||
# 复制构建产物
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# 设置后端地址环境变量(默认指向 hzhub-ai 服务)
|
||||
ENV UPSTREAM_URL=http://hzhub-ai:6039
|
||||
|
||||
# 复制 Nginx 配置模板
|
||||
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 5137
|
||||
|
||||
# 启动 Nginx(使用 envsubst 替换环境变量)
|
||||
CMD /bin/sh -c "envsubst '\$UPSTREAM_URL' < /etc/nginx/templates/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
||||
@@ -1,14 +1,14 @@
|
||||
# RuoYi-AI 用户端
|
||||
# HZHub-AI 用户端
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="https://github.com/ageerle/ruoyi-ai/raw/main/docs/image/logo.png" alt="RuoYi AI Logo" width="120" height="120">
|
||||
<img src="https://github.com/ageerle/hzhub-ai/raw/main/docs/image/logo.png" alt="HZHub AI Logo" width="120" height="120">
|
||||
|
||||
### 企业级AI助手平台 - 用户前端
|
||||
|
||||
*RuoYi-AI 的用户前端,提供 AI 对话、智能体交互、知识库问答等功能*
|
||||
*HZHub-AI 的用户前端,提供 AI 对话、智能体交互、知识库问答等功能*
|
||||
|
||||
**[在线体验](https://web.pandarobot.chat)** | **[后端服务](https://github.com/ageerle/ruoyi-ai)** | **[管理后台](https://github.com/ageerle/ruoyi-admin)**
|
||||
**[在线体验](https://web.pandarobot.chat)** | **[后端服务](https://github.com/ageerle/hzhub-ai)** | **[管理后台](https://github.com/ageerle/hzhub-admin)**
|
||||
|
||||
</div>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
```bash
|
||||
# 克隆后端仓库
|
||||
git clone https://github.com/ageerle/ruoyi-ai.git
|
||||
cd ruoyi-ai
|
||||
git clone https://github.com/ageerle/hzhub-ai.git
|
||||
cd hzhub-ai
|
||||
|
||||
# 启动所有服务(从镜像仓库拉取预构建镜像)
|
||||
docker-compose -f docker-compose-all.yaml up -d
|
||||
@@ -48,7 +48,7 @@ docker-compose -f docker-compose-all.yaml up -d
|
||||
|
||||
```bash
|
||||
# 进入后端项目目录
|
||||
cd ruoyi-ai
|
||||
cd hzhub-ai
|
||||
|
||||
# 启动后端服务(源码编译构建)
|
||||
docker-compose up -d --build
|
||||
@@ -61,7 +61,7 @@ docker-compose logs -f backend
|
||||
|
||||
```bash
|
||||
# 进入用户端项目目录
|
||||
cd ruoyi-web
|
||||
cd hzhub-portal
|
||||
|
||||
# 构建并启动用户端
|
||||
docker-compose up -d --build
|
||||
@@ -74,7 +74,7 @@ docker-compose up -d --build
|
||||
|
||||
```bash
|
||||
# 进入管理端项目目录
|
||||
cd ruoyi-admin
|
||||
cd hzhub-admin
|
||||
|
||||
# 构建并启动管理端
|
||||
docker-compose up -d --build
|
||||
@@ -108,9 +108,9 @@ crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai
|
||||
- `redis:6.2` - Redis 缓存
|
||||
- `weaviate:1.30.0` - 向量数据库
|
||||
- `minio:latest` - 对象存储
|
||||
- `ruoyi-ai-backend:latest` - 后端服务
|
||||
- `ruoyi-ai-admin:latest` - 管理端前端
|
||||
- `ruoyi-ai-web:latest` - 用户端前端
|
||||
- `hzhub-ai-backend:latest` - 后端服务
|
||||
- `hzhub-ai-admin:latest` - 管理端前端
|
||||
- `hzhub-ai-web:latest` - 用户端前端
|
||||
|
||||
## 本地开发
|
||||
|
||||
@@ -143,8 +143,8 @@ A: 一键启动使用预构建的镜像,部署速度快;分步部署从源
|
||||
|
||||
<div align="center">
|
||||
|
||||
**[⭐ 点个Star支持一下](https://github.com/ageerle/ruoyi-web)** • **[Fork 开始贡献](https://github.com/ageerle/ruoyi-web/fork)**
|
||||
**[⭐ 点个Star支持一下](https://github.com/ageerle/hzhub-portal)** • **[Fork 开始贡献](https://github.com/ageerle/hzhub-portal/fork)**
|
||||
|
||||
*用 ❤️ 打造,由 RuoYi AI 开源社区维护*
|
||||
*用 ❤️ 打造,由 HZHub AI 开源社区维护*
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# RuoYi-AI 一键启动全部服务
|
||||
# HZHub-AI 一键启动全部服务
|
||||
# 使用方式: docker-compose up -d
|
||||
#
|
||||
# 包含服务:
|
||||
@@ -6,9 +6,9 @@
|
||||
# - Redis 6.2 (缓存)
|
||||
# - Weaviate (向量数据库)
|
||||
# - MinIO (对象存储)
|
||||
# - RuoYi-Backend (后端服务)
|
||||
# - RuoYi-Admin (管理端前端)
|
||||
# - RuoYi-Web (用户端前端)
|
||||
# - HZHub-Backend (后端服务)
|
||||
# - HZHub-Admin (管理端前端)
|
||||
# - HZHub-Web (用户端前端)
|
||||
#
|
||||
# 镜像仓库地址: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai
|
||||
|
||||
@@ -19,13 +19,13 @@ services:
|
||||
mysql:
|
||||
# 阿里云镜像地址(包含初始化SQL)
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/mysql:v3
|
||||
container_name: ruoyi-ai-mysql
|
||||
container_name: hzhub-ai-mysql
|
||||
restart: always
|
||||
ports:
|
||||
- "23306:3306"
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: ruoyi-ai-agent
|
||||
MYSQL_DATABASE: hzhub-ai-agent
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
@@ -41,7 +41,7 @@ services:
|
||||
# ==================== Redis 缓存 ====================
|
||||
redis:
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/redis:6.2
|
||||
container_name: ruoyi-ai-redis
|
||||
container_name: hzhub-ai-redis
|
||||
restart: always
|
||||
ports:
|
||||
- "26379:6379"
|
||||
@@ -59,7 +59,7 @@ services:
|
||||
# ==================== Weaviate 向量数据库 ====================
|
||||
weaviate:
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/weaviate:1.30.0
|
||||
container_name: ruoyi-ai-weaviate
|
||||
container_name: hzhub-ai-weaviate
|
||||
restart: always
|
||||
ports:
|
||||
- "28080:8080"
|
||||
@@ -78,7 +78,7 @@ services:
|
||||
# ==================== MinIO 对象存储 ====================
|
||||
minio:
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/minio:latest
|
||||
container_name: ruoyi-ai-minio
|
||||
container_name: hzhub-ai-minio
|
||||
restart: always
|
||||
ports:
|
||||
- "29000:9000"
|
||||
@@ -92,10 +92,10 @@ services:
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
# ==================== RuoYi-AI 后端服务 ====================
|
||||
# ==================== HZHub-AI 后端服务 ====================
|
||||
backend:
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/ruoyi-ai-backend:latest
|
||||
container_name: ruoyi-ai-backend
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/hzhub-ai-backend:latest
|
||||
container_name: hzhub-ai-backend
|
||||
restart: always
|
||||
ports:
|
||||
- "26039:6039"
|
||||
@@ -104,7 +104,7 @@ services:
|
||||
# MySQL 配置
|
||||
SPRING_DATASOURCE_DYNAMIC_PRIMARY: master
|
||||
SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_DRIVERCLASSNAME: com.mysql.cj.jdbc.Driver
|
||||
SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_URL: jdbc:mysql://mysql:3306/ruoyi-ai-agent?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_URL: jdbc:mysql://mysql:3306/hzhub-ai-agent?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_USERNAME: root
|
||||
SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_PASSWORD: root
|
||||
# Redis 配置
|
||||
@@ -126,10 +126,10 @@ services:
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
# ==================== RuoYi-AI 管理端前端 ====================
|
||||
# ==================== HZHub-AI 管理端前端 ====================
|
||||
admin-frontend:
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/ruoyi-ai-admin:latest
|
||||
container_name: ruoyi-ai-admin
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/hzhub-ai-admin:latest
|
||||
container_name: hzhub-ai-admin
|
||||
restart: always
|
||||
ports:
|
||||
- "25666:5666"
|
||||
@@ -152,10 +152,10 @@ services:
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
# ==================== RuoYi-AI 用户端前端 ====================
|
||||
# ==================== HZHub-AI 用户端前端 ====================
|
||||
web-frontend:
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/ruoyi-ai-web:latest
|
||||
container_name: ruoyi-ai-web
|
||||
image: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai/hzhub-ai-web:latest
|
||||
container_name: hzhub-ai-web
|
||||
restart: always
|
||||
ports:
|
||||
- "25137:5137"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# ==================== RuoYi-AI 前端服务 ====================
|
||||
# ==================== HZHub-AI 前端服务 ====================
|
||||
frontend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.frontend
|
||||
container_name: ruoyi-ai-web
|
||||
container_name: hzhub-ai-web
|
||||
restart: always
|
||||
ports:
|
||||
- "5137:5137"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "ruoyi-web",
|
||||
"name": "hzhub-portal",
|
||||
"type": "module",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "ruoyi-web open-source PC AI template",
|
||||
"description": "hzhub-portal open-source PC AI template",
|
||||
"author": {
|
||||
"name": "HeJiaYue520",
|
||||
"email": "2834007710@qq.com",
|
||||
|
||||
@@ -61,7 +61,7 @@ function onAfterLeave() {
|
||||
<div class="left-section">
|
||||
<div class="logo-wrap">
|
||||
<img :src="logoPng" class="logo-img">
|
||||
<span class="logo-text">RuoYi-AI</span>
|
||||
<span class="logo-text">HZHub-AI</span>
|
||||
</div>
|
||||
<div class="ad-banner">
|
||||
<SvgIcon name="p-bangong" class-name="animate-up-down" />
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useUserStore } from '@/stores';
|
||||
const greeting = useTimeGreeting();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const username = computed(() => userStore.userInfo?.username ?? '我是 RuoYi-AI智能助手');
|
||||
const username = computed(() => userStore.userInfo?.username ?? '我是 HZHub-AI智能助手');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -211,7 +211,7 @@ function handleMenuCommand(command: string, item: ConversationItem<ChatSessionVo
|
||||
<div v-if="!designStore.isCollapse" class="aside-header">
|
||||
<div class="flex items-center gap-8px hover:cursor-pointer" @click="handleCreatChat">
|
||||
<el-image :src="logo" alt="logo" fit="cover" class="logo-img" />
|
||||
<span class="logo-text max-w-150px text-overflow">RuoYi-AI</span>
|
||||
<span class="logo-text max-w-150px text-overflow">HZHub-AI</span>
|
||||
</div>
|
||||
<Collapse class="ml-auto" />
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!-- 默认消息列表页 -->
|
||||
<script setup lang="ts">
|
||||
import type { FilesCardProps } from 'vue-element-plus-x/types/FilesCard';
|
||||
import type { AnyObject } from 'typescript-api-pro';
|
||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { Sender } from 'vue-element-plus-x';
|
||||
import { getKnowledgeList, getWorkflowList } from '@/api/chat';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { nextTick } from 'vue';
|
||||
import { Sender } from 'vue-element-plus-x';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { send } from '@/api';
|
||||
import { getKnowledgeList } from '@/api/chat';
|
||||
import { getKnowledgeList, getWorkflowList } from '@/api/chat';
|
||||
import FilesSelect from '@/components/FilesSelect/index.vue';
|
||||
import ModelSelect from '@/components/ModelSelect/index.vue';
|
||||
import { useChatStore } from '@/stores/modules/chat';
|
||||
@@ -351,7 +351,7 @@ async function startSSE(chatContent: string) {
|
||||
})) {
|
||||
// 处理数据块 - chunk.result 可能是字符串或对象
|
||||
// 返回 true 表示流结束
|
||||
if (handleDataChunk(chunk.result)) {
|
||||
if (handleDataChunk(chunk.result as AnyObject | string)) {
|
||||
break; // 提前结束流处理
|
||||
}
|
||||
// 等待 Vue 更新 DOM,实现真正的流式渲染
|
||||
|
||||
Reference in New Issue
Block a user