diff --git a/electron_h5/.gitignore b/electron_h5/.gitignore
deleted file mode 100644
index 6d949a5..0000000
--- a/electron_h5/.gitignore
+++ /dev/null
@@ -1,30 +0,0 @@
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
-
-node_modules
-.DS_Store
-electron_h5
-dist-ssr
-coverage
-*.local
-
-/cypress/videos/
-/cypress/screenshots/
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
-.idea
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
-
-*.tsbuildinfo
diff --git a/electron_h5/.vscode/extensions.json b/electron_h5/.vscode/extensions.json
deleted file mode 100644
index a7cea0b..0000000
--- a/electron_h5/.vscode/extensions.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "recommendations": ["Vue.volar"]
-}
diff --git a/electron_h5/README.md b/electron_h5/README.md
deleted file mode 100644
index 14fa460..0000000
--- a/electron_h5/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# electron_h5
-
-This template should help get you started developing with Vue 3 in Vite.
-
-## Recommended IDE Setup
-
-[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
-
-## Customize configuration
-
-See [Vite Configuration Reference](https://vite.dev/config/).
-
-## Project Setup
-
-```sh
-npm install
-```
-
-### Compile and Hot-Reload for Development
-
-```sh
-npm run dev
-```
-
-### Compile and Minify for Production
-
-```sh
-npm run build
-```
diff --git a/electron_h5/docker-compose.yml b/electron_h5/docker-compose.yml
deleted file mode 100644
index 2aeafb8..0000000
--- a/electron_h5/docker-compose.yml
+++ /dev/null
@@ -1,126 +0,0 @@
-version: '2'
-services:
- bqw-ai-system:
- environment:
- TZ: Asia/Shanghai
- LANG: C.UTF-8
- LC_ALL: C.UTF-8
- DIFY_DB_HOST: 10.102.8.56
- DIFY_API_HOST: 10.102.8.56
- DIFY_API_PORT: 30080
- restart: always
- container_name: bqw-ai-system
- image: java:1.8.391
- volumes:
- - ./system/target/bqw-ai.jar:/application/app.jar
- - ./system/logs:/logs
- - ./system/data:/application/data
- command: java -jar -Dfile.encoding=UTF-8 /application/app.jar
- logging:
- driver: "json-file"
- options:
- max-size: "1024m"
- max-file: "3"
- depends_on:
- - bqw-ai-mysql
- - bqw-ai-redis
- bqw-ai-magic:
- environment:
- TZ: Asia/Shanghai
- LANG: C.UTF-8
- LC_ALL: C.UTF-8
- restart: always
- container_name: bqw-ai-magic
- image: java:1.8.391
- depends_on:
- - bqw-ai-mysql
- - bqw-ai-redis
- volumes:
- - ./system/target/magic-api-demo.jar:/application/app.jar
- - ./system/logs:/logs
- - ./system/data:/application/data
- command: java -jar -Dfile.encoding=UTF-8 /application/app.jar
- logging:
- driver: "json-file"
- options:
- max-size: "1024m"
- max-file: "3"
- bqw-ai-mysql:
- environment:
- MYSQL_ROOT_PASSWORD: Mars@23600800
- MYSQL_ROOT_HOST: '%'
- MYSQL_DATABASE: ai-application
- TZ: Asia/Shanghai
- restart: always
- privileged: true
- container_name: bqw-ai-mysql
- image: mysql:8.0.33
- command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
- --explicit_defaults_for_timestamp=true
- --lower_case_table_names=1
- --max_allowed_packet=128M
- --default-authentication-plugin=caching_sha2_password
- volumes:
- - ./mysql/data/:/var/lib/mysql/
- - ./mysql/sql:/docker-entrypoint-initdb.d
- bqw-ai-redis:
- image: redis:7.0.4
- environment:
- TZ: Asia/Shanghai
- restart: always
- container_name: bqw-ai-redis
- volumes:
- - ./redis/conf:/redis/config:rw
- - ./redis/data/:/redis/data/:rw
- command: "redis-server /redis/config/redis.conf"
- privileged: true
- bqw-ai-web:
- image: nginx:1.23.4
- ports:
- - 18900:80
- - 18901:8080
- - 18902:8081
- restart: always
- environment:
- TZ: Asia/Shanghai
- LANG: C.UTF-8
- LC_ALL: C.UTF-8
- container_name: bqw-ai-web
- volumes:
- - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- - ./nginx/html/dist:/usr/share/nginx/html
- - ./nginx/html/chat:/usr/share/nginx/chat
- - ./nginx/html/llm_flow:/usr/share/nginx/llm_flow
- - ./nginx/html/electron_h5:/usr/share/nginx/electron_h5
- depends_on:
- - bqw-ai-system
- logging:
- driver: "json-file"
- options:
- max-size: "1024m"
- max-file: "3"
- bqw-ai-minio:
- image: minio/minio
- privileged: true
- restart: always
- container_name: bqw-ai-minio
- # ports:
- # # api端口
- # - 9000:9000
- # # 控制台页面端口
- # - 9011:9011
- environment:
- TZ: Asia/Shanghai
- MINIO_ACCESS_KEY: admin
- MINIO_SECRET_KEY: Huashiai@2024
- volumes:
- - ./minio/data:/data
- - /etc/localtime:/etc/localtime:ro
- command: server /data --console-address ":9011"
- logging:
- driver: "json-file"
- options:
- max-size: "1024m"
- max-file: "3"
diff --git a/electron_h5/index.html b/electron_h5/index.html
deleted file mode 100644
index c1f99ce..0000000
--- a/electron_h5/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
- 龙岗区百千万AI智能体共创平台
-
-
-
-
-
-
diff --git a/electron_h5/jsconfig.json b/electron_h5/jsconfig.json
deleted file mode 100644
index 5a1f2d2..0000000
--- a/electron_h5/jsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "compilerOptions": {
- "paths": {
- "@/*": ["./src/*"]
- }
- },
- "exclude": ["node_modules", "dist"]
-}
diff --git a/electron_h5/nginx.conf b/electron_h5/nginx.conf
deleted file mode 100644
index 0d21b83..0000000
--- a/electron_h5/nginx.conf
+++ /dev/null
@@ -1,276 +0,0 @@
-user root;
-worker_processes auto;
-
-error_log /var/log/nginx/error.log notice;
-pid /var/run/nginx.pid;
-
-
-events {
- worker_connections 1024;
-}
-
-
-http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
-
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- access_log /var/log/nginx/access.log main;
- sendfile on;
- #tcp_nopush on;
- keepalive_timeout 65;
- #gzip on;
- gzip on;
- gzip_min_length 1k;
- gzip_comp_level 9;
- gzip_types text/plain application/x-javascript text/javascript application/x-httpd-php text/css text/xml text/jsp application/eot application/ttf application/otf application/svg application/woff application/javascript application/xml image/jpeg image/gif image/png;
- gzip_vary on;
- gzip_disable "MSIE [1-6].";
- # 除去 Web 站点中的信用卡号
- sub_filter '(\d{4}[- ]?){3}\d{4}' '**** **** **** ****';
- sub_filter_once off;
-
- # 全局设置允许的最大请求体大小
- client_max_body_size 2048m;
-
- server {
- listen 80;
- server_name localhost;
- location ^~/bqw-ai {
- proxy_pass http://bqw-ai-system:8080/bqw-ai;
- proxy_set_header Host 127.0.0.1;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
-
- # 允许跨域请求
- add_header Access-Control-Allow-Origin *;
- # 允许带身份验证信息的跨域请求
- add_header Access-Control-Allow-Credentials true;
- # 允许的请求方法
- add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
- # 允许的请求头
- add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
- # 预检请求的有效期
- add_header Access-Control-Max-Age 3600;
- # 处理 OPTIONS 请求
- if ($request_method = 'OPTIONS') {
- add_header Content-Type 'text/plain; charset=utf-8';
- add_header Content-Length 0;
- return 204;
- }
- }
-
- location /bqw-ai/websocket {
- proxy_pass http://bqw-ai-system:8080/bqw-ai/websocket;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_read_timeout 900s;
- }
-
- location / {
- root /usr/share/nginx/html/;
- index index.html index.htm;
- if (!-e $request_filename) {
- rewrite ^(.*)$ /index.html?s=$1last;
- break;
- }
- }
-
- location /h5_client {
- alias /usr/share/nginx/llm_flow/;
- index index.html index.htm;
- }
-
- location /electron_h5 {
- alias /usr/share/nginx/electron_h5/;
- index index.html index.htm;
- }
-
- # http://10.180.6.206
- # https://xtbg.lg.gov.cn/LGOA
-
-
- location /LGOA {
- proxy_pass https://xtbg.lg.gov.cn/LGOA;
- }
- location /OAZS {
- proxy_pass http://10.180.6.206/OAZS;
- }
-
-
- location /magic {
- proxy_pass http://bqw-ai-magic:9999/magic;
- }
-
-
-
-
-
- location /magic/web/console {
- proxy_pass http://bqw-ai-magic:9999/magic/web/console;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_read_timeout 900s;
- }
-
-
- # minio-api
- location /minio-api/ {
- proxy_pass http://bqw-ai-minio:9000/;
- }
-
- #minio页面
- location /minio/login {
- proxy_pass http://bqw-ai-minio:9011;
- # 启用支持websocket连接
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- client_max_body_size 1024m;
- proxy_http_version 1.1;
- proxy_connect_timeout 3600;
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-Host $http_host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
-
-
- location /bqw-ai/sys/common/static/bqw-ai-file/ {
- proxy_pass http://bqw-ai-minio:9000/bqw-ai-file/;
-
- # 可选:添加一些常用的代理设置
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- # 如果需要处理大文件上传或下载,可以调整超时时间
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- }
-
-
- location /h5_client/bqw-ai-file/ {
- proxy_pass http://bqw-ai-minio:9000/bqw-ai-file/;
-
- # 可选:添加一些常用的代理设置
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- # 如果需要处理大文件上传或下载,可以调整超时时间
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- }
-
-
-
- location /bqw-video/ {
- proxy_pass http://10.102.8.55:8090/;
-
- # 可选:添加一些常用的代理设置
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- # 如果需要处理大文件上传或下载,可以调整超时时间
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- }
-
-
- location /bqw-ai-file/ {
- proxy_pass http://bqw-ai-minio:9000/bqw-ai-file/;
-
- # 可选:添加一些常用的代理设置
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- # 如果需要处理大文件上传或下载,可以调整超时时间
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- }
-
-
-
-
-
-
-
-
-
-
- }
- server {
-
- listen 8081;
- server_name localhost;
-
- client_max_body_size 2000M;
-
- # minio-api
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
-
- proxy_connect_timeout 300;
- # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
- proxy_http_version 1.1;
- proxy_set_header Connection "";
- chunked_transfer_encoding off;
-
- proxy_pass http://bqw-ai-minio:9000/;
- }
-
-
- }
-
- server {
- listen 8080;
- server_name localhost;
-
-
-
- # minio-api
- location /minio-api/ {
- proxy_pass http://bqw-ai-minio:9000/;
- }
-
- #minio页面
- location / {
- proxy_pass http://bqw-ai-minio:9011;
- # 启用支持websocket连接
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- client_max_body_size 1024m;
- proxy_http_version 1.1;
- proxy_connect_timeout 3600;
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-Host $http_host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
-
- }
-
- include /etc/nginx/conf.d/*.conf;
-}
diff --git a/electron_h5/package.json b/electron_h5/package.json
deleted file mode 100644
index 688edb8..0000000
--- a/electron_h5/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "electron_h5",
- "version": "0.0.0",
- "private": true,
- "type": "module",
- "scripts": {
- "dev": "vite",
- "build": "vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "vue": "^3.5.13",
- "vue-router": "^4.5.0"
- },
- "devDependencies": {
- "@vitejs/plugin-vue": "^5.2.3",
- "vite": "^6.2.4",
- "vite-plugin-vue-devtools": "^7.7.2"
- }
-}
diff --git a/electron_h5/public/favicon.ico b/electron_h5/public/favicon.ico
deleted file mode 100644
index df36fcf..0000000
Binary files a/electron_h5/public/favicon.ico and /dev/null differ
diff --git a/electron_h5/src/App.vue b/electron_h5/src/App.vue
deleted file mode 100644
index cb98d72..0000000
--- a/electron_h5/src/App.vue
+++ /dev/null
@@ -1,216 +0,0 @@
-
-
-
-
-
-
-
diff --git a/electron_h5/src/MainApp.vue b/electron_h5/src/MainApp.vue
deleted file mode 100644
index 018e70d..0000000
--- a/electron_h5/src/MainApp.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/electron_h5/src/assets/base.css b/electron_h5/src/assets/base.css
deleted file mode 100644
index 8816868..0000000
--- a/electron_h5/src/assets/base.css
+++ /dev/null
@@ -1,86 +0,0 @@
-/* color palette from */
-:root {
- --vt-c-white: #ffffff;
- --vt-c-white-soft: #f8f8f8;
- --vt-c-white-mute: #f2f2f2;
-
- --vt-c-black: #181818;
- --vt-c-black-soft: #222222;
- --vt-c-black-mute: #282828;
-
- --vt-c-indigo: #2c3e50;
-
- --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
- --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
- --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
- --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
-
- --vt-c-text-light-1: var(--vt-c-indigo);
- --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
- --vt-c-text-dark-1: var(--vt-c-white);
- --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
-}
-
-/* semantic color variables for this project */
-:root {
- --color-background: var(--vt-c-white);
- --color-background-soft: var(--vt-c-white-soft);
- --color-background-mute: var(--vt-c-white-mute);
-
- --color-border: var(--vt-c-divider-light-2);
- --color-border-hover: var(--vt-c-divider-light-1);
-
- --color-heading: var(--vt-c-text-light-1);
- --color-text: var(--vt-c-text-light-1);
-
- --section-gap: 160px;
-}
-
-@media (prefers-color-scheme: dark) {
- :root {
- --color-background: var(--vt-c-black);
- --color-background-soft: var(--vt-c-black-soft);
- --color-background-mute: var(--vt-c-black-mute);
-
- --color-border: var(--vt-c-divider-dark-2);
- --color-border-hover: var(--vt-c-divider-dark-1);
-
- --color-heading: var(--vt-c-text-dark-1);
- --color-text: var(--vt-c-text-dark-2);
- }
-}
-
-*,
-*::before,
-*::after {
- box-sizing: border-box;
- margin: 0;
- font-weight: normal;
-}
-
-body {
- min-height: 100vh;
- color: var(--color-text);
- background: var(--color-background);
- transition:
- color 0.5s,
- background-color 0.5s;
- line-height: 1.6;
- font-family:
- Inter,
- -apple-system,
- BlinkMacSystemFont,
- 'Segoe UI',
- Roboto,
- Oxygen,
- Ubuntu,
- Cantarell,
- 'Fira Sans',
- 'Droid Sans',
- 'Helvetica Neue',
- sans-serif;
- font-size: 15px;
- text-rendering: optimizeLegibility;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
diff --git a/electron_h5/src/assets/electron.svg b/electron_h5/src/assets/electron.svg
deleted file mode 100644
index 45ef09c..0000000
--- a/electron_h5/src/assets/electron.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/electron_h5/src/assets/logo.png b/electron_h5/src/assets/logo.png
deleted file mode 100644
index ef40391..0000000
Binary files a/electron_h5/src/assets/logo.png and /dev/null differ
diff --git a/electron_h5/src/assets/logo.svg b/electron_h5/src/assets/logo.svg
deleted file mode 100644
index 7565660..0000000
--- a/electron_h5/src/assets/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/electron_h5/src/assets/longxiaoi_I.png b/electron_h5/src/assets/longxiaoi_I.png
deleted file mode 100644
index 5e39869..0000000
Binary files a/electron_h5/src/assets/longxiaoi_I.png and /dev/null differ
diff --git a/electron_h5/src/assets/lxI_120.png b/electron_h5/src/assets/lxI_120.png
deleted file mode 100644
index 050cbcf..0000000
Binary files a/electron_h5/src/assets/lxI_120.png and /dev/null differ
diff --git a/electron_h5/src/assets/lxi_200.png b/electron_h5/src/assets/lxi_200.png
deleted file mode 100644
index 0df6fe7..0000000
Binary files a/electron_h5/src/assets/lxi_200.png and /dev/null differ
diff --git a/electron_h5/src/assets/main.css b/electron_h5/src/assets/main.css
deleted file mode 100644
index 36fb845..0000000
--- a/electron_h5/src/assets/main.css
+++ /dev/null
@@ -1,35 +0,0 @@
-@import './base.css';
-
-#app {
- max-width: 1280px;
- margin: 0 auto;
- padding: 2rem;
- font-weight: normal;
-}
-
-a,
-.green {
- text-decoration: none;
- color: hsla(160, 100%, 37%, 1);
- transition: 0.4s;
- padding: 3px;
-}
-
-@media (hover: hover) {
- a:hover {
- background-color: hsla(160, 100%, 37%, 0.2);
- }
-}
-
-@media (min-width: 1024px) {
- body {
- display: flex;
- place-items: center;
- }
-
- #app {
- display: grid;
- grid-template-columns: 1fr 1fr;
- padding: 0 2rem;
- }
-}
diff --git a/electron_h5/src/assets/wavy-lines.svg b/electron_h5/src/assets/wavy-lines.svg
deleted file mode 100644
index d08c611..0000000
--- a/electron_h5/src/assets/wavy-lines.svg
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/electron_h5/src/components/ApiConfig.vue b/electron_h5/src/components/ApiConfig.vue
deleted file mode 100644
index a26128b..0000000
--- a/electron_h5/src/components/ApiConfig.vue
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
diff --git a/electron_h5/src/components/HelloWorld.vue b/electron_h5/src/components/HelloWorld.vue
deleted file mode 100644
index eff59f1..0000000
--- a/electron_h5/src/components/HelloWorld.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
{{ msg }}
-
- You’ve successfully created a project with
- Vite +
- Vue 3 .
-
-
-
-
-
diff --git a/electron_h5/src/components/TheWelcome.vue b/electron_h5/src/components/TheWelcome.vue
deleted file mode 100644
index fe48afc..0000000
--- a/electron_h5/src/components/TheWelcome.vue
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
- Documentation
-
- Vue’s
- official documentation
- provides you with all information you need to get started.
-
-
-
-
-
-
- Tooling
-
- This project is served and bundled with
- Vite . The
- recommended IDE setup is
- VSCode
- +
- Vue - Official . If
- you need to test your components and web pages, check out
- Vitest
- and
- Cypress
- /
- Playwright .
-
-
-
- More instructions are available in
- README.md .
-
-
-
-
-
-
- Ecosystem
-
- Get official tools and libraries for your project:
- Pinia ,
- Vue Router ,
- Vue Test Utils , and
- Vue Dev Tools . If
- you need more resources, we suggest paying
- Awesome Vue
- a visit.
-
-
-
-
-
-
- Community
-
- Got stuck? Ask your question on
- Vue Land
- (our official Discord server), or
- StackOverflow . You should also follow the official
- @vuejs.org
- Bluesky account or the
- @vuejs
- X account for latest news in the Vue world.
-
-
-
-
-
-
- Support Vue
-
- As an independent project, Vue relies on community backing for its sustainability. You can help
- us by
- becoming a sponsor .
-
-
diff --git a/electron_h5/src/components/Versions.vue b/electron_h5/src/components/Versions.vue
deleted file mode 100644
index 35136c0..0000000
--- a/electron_h5/src/components/Versions.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- Electron v{{ versions.electron }}
- Chromium v{{ versions.chrome }}
- Node v{{ versions.node }}
-
-
diff --git a/electron_h5/src/components/WelcomeItem.vue b/electron_h5/src/components/WelcomeItem.vue
deleted file mode 100644
index 6d7086a..0000000
--- a/electron_h5/src/components/WelcomeItem.vue
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
diff --git a/electron_h5/src/components/icons/IconCommunity.vue b/electron_h5/src/components/icons/IconCommunity.vue
deleted file mode 100644
index 2dc8b05..0000000
--- a/electron_h5/src/components/icons/IconCommunity.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/electron_h5/src/components/icons/IconDocumentation.vue b/electron_h5/src/components/icons/IconDocumentation.vue
deleted file mode 100644
index 6d4791c..0000000
--- a/electron_h5/src/components/icons/IconDocumentation.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/electron_h5/src/components/icons/IconEcosystem.vue b/electron_h5/src/components/icons/IconEcosystem.vue
deleted file mode 100644
index c3a4f07..0000000
--- a/electron_h5/src/components/icons/IconEcosystem.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/electron_h5/src/components/icons/IconSupport.vue b/electron_h5/src/components/icons/IconSupport.vue
deleted file mode 100644
index 7452834..0000000
--- a/electron_h5/src/components/icons/IconSupport.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/electron_h5/src/components/icons/IconTooling.vue b/electron_h5/src/components/icons/IconTooling.vue
deleted file mode 100644
index 660598d..0000000
--- a/electron_h5/src/components/icons/IconTooling.vue
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
diff --git a/electron_h5/src/main.js b/electron_h5/src/main.js
deleted file mode 100644
index 8a2e5d2..0000000
--- a/electron_h5/src/main.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import { createApp } from 'vue'
-import router from './router'
-import MainApp from './MainApp.vue'
-
-const app = createApp(MainApp)
-app.use(router)
-app.mount('#app')
diff --git a/electron_h5/src/router/index.js b/electron_h5/src/router/index.js
deleted file mode 100644
index fd16382..0000000
--- a/electron_h5/src/router/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import { createRouter, createWebHashHistory } from 'vue-router'
-import App from '../App.vue'
-import ApiConfig from '../components/ApiConfig.vue'
-
-const routes = [
- {
- path: '/',
- name: 'home',
- component: App
- },
- {
- path: '/config',
- name: 'config',
- component: ApiConfig
- }
-]
-
-const router = createRouter({
- history: createWebHashHistory(),
- routes
-})
-
-export default router
\ No newline at end of file
diff --git a/electron_h5/vite.config.js b/electron_h5/vite.config.js
deleted file mode 100644
index bbcac17..0000000
--- a/electron_h5/vite.config.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import { fileURLToPath, URL } from 'node:url'
-
-import { defineConfig } from 'vite'
-import vue from '@vitejs/plugin-vue'
-import vueDevTools from 'vite-plugin-vue-devtools'
-
-// https://vite.dev/config/
-export default defineConfig({
- base: "/electron_h5",
- plugins: [
- vue(),
- vueDevTools(),
- ],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- },
- },
- build: {
- outDir: 'electron_h5', // 指定输出目录为 electron_h5
- }
-})
diff --git a/src/main/index.js b/src/main/index.js
index 5db5b5e..c67e91f 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -1,7 +1,7 @@
import { app, shell, BrowserWindow, ipcMain, Menu, session, screen, dialog } from 'electron'
import { electronApp, optimizer } from '@electron-toolkit/utils'
import Store from 'electron-store'
-import { createWindow, createDrageWindow, unregisterAllShortcuts } from './window.js'
+import { createWindow, createDrageWindow, unregisterAllShortcuts, getMainWindow } from './window.js'
import { setupIPC } from './ipc.js'
import { createTray, destroyTray,clearBrowserCache } from './tray.js'
import XEUtils from 'xe-utils'
@@ -13,6 +13,7 @@ import { clearAllSessionData } from './utils/cacheUtils.js'
import SingleInstanceManager from './utils/singleInstance.js'
import { setStoreValue, getStoreValue ,deleteStore} from './store.js'
import AutoLaunch from 'auto-launch'
+import axios from 'axios'
import WebSocketClient from './utils/WebSocketClient';
@@ -273,6 +274,12 @@ if (!isFirstInstance) {
app.on('window-all-closed', async (event) => {
if (process.platform !== 'darwin') {
event.preventDefault();
+ // 如果是重启过程,不执行任何清理操作
+ if (app.isRestarting) {
+ logger.info('检测到重启过程,跳过窗口关闭处理')
+ return;
+ }
+
if (!app.isQuiting) {
// 如果不是主动退出,则隐藏所有窗口
@@ -300,6 +307,12 @@ if (!isFirstInstance) {
})
app.on('before-quit', async (event) => {
+ // 如果是重启过程,不执行任何清理操作
+ if (app.isRestarting) {
+ logger.info('检测到重启过程,跳过before-quit处理')
+ return;
+ }
+
// 在应用程序即将退出时执行操作,例如保存数据
event.preventDefault();
@@ -317,6 +330,11 @@ if (!isFirstInstance) {
// 在应用退出时注销所有快捷键
app.on('will-quit', async (event) => {
+ // 如果是重启过程,不执行任何清理操作
+ if (app.isRestarting) {
+ logger.info('检测到重启过程,跳过will-quit处理')
+ return;
+ }
event.preventDefault();
diff --git a/src/main/ipc.js b/src/main/ipc.js
index 0e69d0f..6e64c5d 100644
--- a/src/main/ipc.js
+++ b/src/main/ipc.js
@@ -334,4 +334,50 @@ export function setupIPC() {
throw error;
}
});
+
+ // 重启软件
+ ipcMain.handle('restartApp', async (event) => {
+ logger.info("=============================重启软件");
+ try {
+ // 标记为正在重启,避免其他退出逻辑干扰
+ app.isRestarting = true;
+
+ // 确保所有窗口都被正确关闭
+ const windows = BrowserWindow.getAllWindows();
+ logger.info(`准备关闭 ${windows.length} 个窗口`);
+
+ windows.forEach(window => {
+ if (!window.isDestroyed()) {
+ try {
+ window.close();
+ logger.info('窗口关闭成功');
+ } catch (error) {
+ logger.warn('关闭窗口时出错:', error);
+ }
+ }
+ });
+
+ // 延迟执行重启,确保窗口关闭完成
+ setTimeout(() => {
+ try {
+ logger.info('执行应用重启');
+ app.relaunch();
+ app.exit(0);
+ } catch (error) {
+ logger.error('重启应用失败,尝试强制退出:', error);
+ try {
+ app.quit();
+ } catch (quitError) {
+ logger.error('强制退出也失败:', quitError);
+ process.exit(0);
+ }
+ }
+ }, 1000);
+
+ return { success: true };
+ } catch (error) {
+ logger.error(`重启软件失败: ${error.message}`);
+ throw error;
+ }
+ });
}
diff --git a/src/main/tray.js b/src/main/tray.js
index 832d788..97ce3b1 100644
--- a/src/main/tray.js
+++ b/src/main/tray.js
@@ -13,6 +13,62 @@ let tray = null
import {checkForUpdates} from "./utils/updateUtils"
+// 安全重启应用函数
+function safeRestartApp() {
+ return new Promise((resolve) => {
+ try {
+ logger.info('开始安全重启应用')
+
+ // 标记为正在重启,避免其他退出逻辑干扰
+ app.isRestarting = true
+
+ // 确保所有窗口都被正确关闭
+ const windows = BrowserWindow.getAllWindows()
+ logger.info(`准备关闭 ${windows.length} 个窗口`)
+
+ windows.forEach(window => {
+ if (!window.isDestroyed()) {
+ try {
+ window.close()
+ logger.info('窗口关闭成功')
+ } catch (error) {
+ logger.warn('关闭窗口时出错:', error)
+ }
+ }
+ })
+
+ // 延迟执行重启,确保窗口关闭完成
+ setTimeout(() => {
+ try {
+ logger.info('执行应用重启')
+ app.relaunch()
+ app.exit(0)
+ resolve(true)
+ } catch (error) {
+ logger.error('重启应用失败,尝试强制退出:', error)
+ try {
+ app.quit()
+ } catch (quitError) {
+ logger.error('强制退出也失败:', quitError)
+ process.exit(0)
+ }
+ resolve(false)
+ }
+ }, 1000) // 增加延迟时间到1秒
+
+ } catch (error) {
+ logger.error('安全重启失败:', error)
+ try {
+ app.quit()
+ } catch (quitError) {
+ logger.error('强制退出失败:', quitError)
+ process.exit(0)
+ }
+ resolve(false)
+ }
+ })
+}
+
export async function clearBrowserCache() {
try {
// 使用统一的缓存清理函数
@@ -100,31 +156,7 @@ export function createTray() {
}
},
- { type: 'separator' },
- {
- label: '清除缓存',
- click: async () => {
- await clearBrowserCache()
- // 删除配置文件
- try {
- const userDataPath = app.getPath('userData')
- const configPath = join(userDataPath, 'config.json')
- if (fs.existsSync(configPath)) {
- fs.unlinkSync(configPath)
- logger.info('配置文件删除成功')
- }
- } catch (error) {
- logger.error('删除配置文件失败:', error)
- }
-
- // 重新加载所有窗口
- const windows = BrowserWindow.getAllWindows()
- for (const window of windows) {
- window.reload()
- }
- }
- },
{ type: 'separator' },
{
label: '退出登录',
diff --git a/src/main/utils/networkUtils.js b/src/main/utils/networkUtils.js
new file mode 100644
index 0000000..65af51b
--- /dev/null
+++ b/src/main/utils/networkUtils.js
@@ -0,0 +1,76 @@
+import axios from 'axios';
+import logger from './logger';
+import { getStoreValue } from '../store.js';
+
+/**
+ * 检测网络连接是否正常
+ * @param {string} url - 要检测的URL,如果不提供则使用默认的客户端地址
+ * @param {number} timeout - 超时时间,默认5秒
+ * @returns {Promise} - 返回网络连接状态
+ */
+export async function checkNetworkConnection(url = null, timeout = 5000) {
+ try {
+ // 如果没有提供URL,则使用存储的客户端地址
+ if (!url) {
+ const h5ClientUrl = getStoreValue("h5_client_url");
+ if (!h5ClientUrl) {
+ logger.warn('网络检测:未找到客户端地址配置');
+ return false;
+ }
+ url = h5ClientUrl;
+ }
+
+ logger.info(`网络检测:开始检测 ${url} 的连接状态`);
+
+ // 发送HEAD请求检测网络连接
+ const response = await axios.head(url, {
+ timeout: timeout,
+ validateStatus: function (status) {
+ // 接受2xx和3xx的状态码
+ return status >= 200 && status < 400;
+ }
+ });
+
+ logger.info(`网络检测:连接成功,状态码 ${response.status}`);
+ return true;
+
+ } catch (error) {
+ logger.warn(`网络检测:连接失败 - ${error.message}`);
+
+ // 如果是超时错误,记录更详细的信息
+ if (error.code === 'ECONNABORTED') {
+ logger.warn(`网络检测:请求超时 (${timeout}ms)`);
+ } else if (error.code === 'ENOTFOUND') {
+ logger.warn('网络检测:无法解析主机名');
+ } else if (error.code === 'ECONNREFUSED') {
+ logger.warn('网络检测:连接被拒绝');
+ }
+
+ return false;
+ }
+}
+
+/**
+ * 检测多个URL的网络连接
+ * @param {Array} urls - 要检测的URL数组
+ * @param {number} timeout - 超时时间,默认5秒
+ * @returns {Promise} - 返回每个URL的检测结果
+ */
+export async function checkMultipleNetworkConnections(urls, timeout = 5000) {
+ const results = {};
+
+ for (const url of urls) {
+ results[url] = await checkNetworkConnection(url, timeout);
+ }
+
+ return results;
+}
+
+/**
+ * 检测默认客户端地址的网络连接
+ * @param {number} timeout - 超时时间,默认5秒
+ * @returns {Promise} - 返回网络连接状态
+ */
+export async function checkDefaultClientConnection(timeout = 5000) {
+ return await checkNetworkConnection(null, timeout);
+}
\ No newline at end of file
diff --git a/src/main/window.js b/src/main/window.js
index 02d6858..0e23a99 100644
--- a/src/main/window.js
+++ b/src/main/window.js
@@ -5,6 +5,7 @@ import icon from '../../resources/icon.png?asset'
import { isApiDatasetsDocumentsPath, extractIdFromPath } from './utils/difyUtils.js'
import XEUtils from 'xe-utils'
import logger from './utils/logger'
+import { checkDefaultClientConnection } from './utils/networkUtils.js'
import { createMenu } from './menu.js'
import { setStoreValue, getStoreValue,deleteStore } from './store.js'
@@ -166,16 +167,38 @@ export async function createWindow() {
// 加载存储的 URL
mainWindow.loadURL(h5_client_url)
+ // 监听页面加载失败事件
+ mainWindow.webContents.on('did-fail-load', (event, errorCode, errorDescription, validatedURL) => {
+ logger.error(`主窗口页面加载失败: code=${errorCode}, desc=${errorDescription}, url=${validatedURL}`)
+ // 跳转到网络错误页面
+
+ if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
+ mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'] + '/#/network_error')
+ } else {
+ mainWindow.loadFile(join(__dirname, '../renderer/index.html'), { hash: '/network_error' })
+ }
+
+
+ })
+
// 接口超过30分钟不活动,则退出登录
await tokenExpireTimer()
- setTimeout(()=>{
+ setTimeout(async ()=>{
try {
// 注册全局快捷键
registerShortcuts(mainWindow)
- checkForUpdates({},false)
+
+ // 先检测网络连接,如果网络正常再调用版本检测升级
+ const isNetworkConnected = await checkDefaultClientConnection(5000);
+ if (isNetworkConnected) {
+ logger.info('网络连接正常,开始检查版本更新');
+ checkForUpdates({},false)
+ } else {
+ logger.warn('网络连接异常,跳过版本检测升级');
+ }
}catch (e) {
logger.info(e)
}
diff --git a/src/renderer/index.html b/src/renderer/index.html
index 0898743..ae40dfd 100644
--- a/src/renderer/index.html
+++ b/src/renderer/index.html
@@ -2,7 +2,7 @@
- Dify Market Manager
+ 百千万AI
{
const saveConfig = async () => {
try {
await window.electron.ipcRenderer.invoke('setStoreValue', 'h5_client_url', h5ClientUrl.value)
- alert('保存成功')
- // 关闭当前窗口
- window.electron.ipcRenderer.send('closeConfigWindow')
+
+ // 重启应用
+ await window.electron.ipcRenderer.invoke('restartApp')
} catch (error) {
alert('保存失败:' + error.message)
}
diff --git a/src/renderer/src/components/network_error.vue b/src/renderer/src/components/network_error.vue
new file mode 100644
index 0000000..631effe
--- /dev/null
+++ b/src/renderer/src/components/network_error.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
网络连接错误
+
无法连接到服务器,请检查您的网络连接
+
+ 重启服务
+
+
+
+ 💡 提示:在系统托盘中找到软件图标,右键单击 配置 -> 配置客户端地址 ,查看客户端地址是否正确以及是否有网络访问权限
+
+
+
+
+
+
+
+
+
diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js
index fd16382..c4ed6fb 100644
--- a/src/renderer/src/router/index.js
+++ b/src/renderer/src/router/index.js
@@ -1,6 +1,7 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import App from '../App.vue'
import ApiConfig from '../components/ApiConfig.vue'
+import NetworkError from '../components/network_error.vue'
const routes = [
{
@@ -12,6 +13,11 @@ const routes = [
path: '/config',
name: 'config',
component: ApiConfig
+ },
+ {
+ path: '/network_error',
+ name: 'network_error',
+ component: NetworkError
}
]