From 5f210b767c1818861ef8de55a57fdc2c55f61728 Mon Sep 17 00:00:00 2001 From: "du.meimei" Date: Tue, 27 May 2025 16:05:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BC=8A=E5=88=A9GPT?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 nginx 配置中添加 /yiligpt路径,跳转到伊利GPT页面 - 在 Dockerfile 中使用自定义的 default.conf 文件- 在 vue.config.js 中添加 /yiligpt 代理配置,指向 AI 助手 URL --- docker/Dockerfile | 4 ++-- docker/default.conf | 7 ++++++- vue.config.js | 9 ++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index cb280939..d80e1a05 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,5 +10,5 @@ ARG URL_DIR= COPY ${DIST_DIR} /var/www/html/${URL_DIR} RUN sed -i "s/\ \/index.html/\ \/${URL_DIR}\/index.html/g" /etc/nginx/conf.d/default.conf # 默认不建议使用自定义nginx配置,如必须使用,请提前沟通 -# COPY ./nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 \ No newline at end of file +COPY ./default.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 diff --git a/docker/default.conf b/docker/default.conf index f2b8d513..a6e87f1a 100644 --- a/docker/default.conf +++ b/docker/default.conf @@ -5,6 +5,11 @@ server { #charset koi8-r; #access_log /var/log/nginx/host.access.log main; + # 跳转到伊利GPT + location /yiligpt { + return 302 https://yiligpt.x.digitalyili.com/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share; + } + location / { root /var/www/html; index index.html index.htm; @@ -18,4 +23,4 @@ server { root /var/www/html; } -} \ No newline at end of file +} diff --git a/vue.config.js b/vue.config.js index f243dd1e..702f5d2f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,7 +3,7 @@ const Components = require('unplugin-vue-components/webpack'); const { ElementPlusResolver } = require('unplugin-vue-components/resolvers'); const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); const LodashModuleReplacementPlugin = require("lodash-webpack-plugin"); -const { proxyUrl, proxyUrlDelivery } = require('./src/config'); +const { proxyUrl, proxyUrlDelivery,aiAssistantUrl } = require('./src/config'); const { baseOss } = require('./src/config'); const path = require('path'); @@ -33,6 +33,13 @@ module.exports = { }, cookieDomainRewrite: 'localhost', }, + '/yiligpt': { + target: `${ aiAssistantUrl }`, + changeOrigin: true, + pathRewrite: { + '^/yiligpt': '', // 路径重写 + }, + }, // '/daixin': { // target: proxyUrlMessageCenter, // changeOrigin: false,