From 0564f5f89d82e15698e3ab43d66a93eaaa2ee66f Mon Sep 17 00:00:00 2001 From: lijing Date: Tue, 20 Oct 2026 11:01:52 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=B8=BB=E9=A2=98=E9=80=9A=E9=81=93?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AD=A5=E6=8C=82=E8=BD=BD=20+=20=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=20Vue3=20=E5=89=8D=E5=9F=BA=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 11 +++++++++++ config/index.js | 8 ++++---- public/index.html | 20 ++++++++++++++++++++ src/frame/layout.vue | 3 ++- vue.config.js | 26 ++++++++++++++++++-------- 5 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 .env.development diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..f4d261a --- /dev/null +++ b/.env.development @@ -0,0 +1,11 @@ +# 开发环境(Vue CLI 默认 mode=development 时自动加载本文件) +# +# 主题通道接入说明(《云海子应用前端接入规范》§2.2 第一步): +# 1. public/index.html 已插入 A 类 loader,主题/皮肤由通道 /static/js/yh-theme-init.js 下发; +# 2. 本地 dev 的 /static 请求由 vue.config.js 的 devServer.proxy 兜到主题通道; +# 3. 默认通道地址 http://base.yunhaixingtong.com,联调本地通道源时用环境变量覆盖: +# YH_THEME_PROXY_TARGET=http://localhost:9527 npm run dev +# 4. 跨源直连(VITE_THEME_HOST)是 Vite 工程的机制,本项目为 Vue CLI(webpack), +# 内联脚本里的 %VITE_THEME_HOST% 会被判为占位符并置空,统一走上面的 dev 代理。 +# +# 说明:本文件不含敏感配置,仅作接入连法备忘。 diff --git a/config/index.js b/config/index.js index 516f488..c7740d3 100644 --- a/config/index.js +++ b/config/index.js @@ -1,7 +1,7 @@ window.conf = { - baseHost: "http://base.bestsch.com", - ssoHost: "http://sso.bestsch.com", - serviceUrl: "http://192.168.10.166:8087", - fileHost:'http://base.bestsch.com/ClassroomMan/file', + baseHost: "http://base.yunhaixingtong.com", + ssoHost: "http://sso.yunhaixingtong.com", + serviceUrl: "http://base.yunhaixingtong.com/userclass", + fileHost: "http://base.yunhaixingtong.com/userclass", isLayoutOld: false, }; \ No newline at end of file diff --git a/public/index.html b/public/index.html index d94e441..d989584 100644 --- a/public/index.html +++ b/public/index.html @@ -13,6 +13,26 @@ + +
diff --git a/src/frame/layout.vue b/src/frame/layout.vue index 6438498..9390cb0 100644 --- a/src/frame/layout.vue +++ b/src/frame/layout.vue @@ -99,7 +99,8 @@ - + + 首页 diff --git a/vue.config.js b/vue.config.js index 64c0450..926b1f8 100644 --- a/vue.config.js +++ b/vue.config.js @@ -76,14 +76,24 @@ module.exports = { https: false, //是否开启https hotOnly: true, //是否配置热更新 open: true, //配置自动启动浏览器 - // proxy: { //配置多个代理跨域(配置一个 proxy: 'http://localhost:4000' ) - // '/api': { - // target: 'http://basedebug.bestsch.com/BschHome', - // ws: true, //是否跨域 - // changeOrigin: true, - // // pathRewrite: { '^/api': '' } - // } - // }, + // 主题通道 dev 代理(A 类接入 §2.2 第一步): + // 本地开发时 /static/* 兜到主题通道(默认线上通道),联调本地通道源可覆盖: + // YH_THEME_PROXY_TARGET=http://localhost:9527 npm run dev + // 生产与通道同源,不依赖本代理。 + proxy: { + "/static": { + target: process.env.YH_THEME_PROXY_TARGET || "http://base.yunhaixingtong.com", + changeOrigin: true, + ws: true + } + // 原有业务接口代理示例(按需启用): + // '/api': { + // target: 'http://basedebug.bestsch.com/BschHome', + // ws: true, //是否跨域 + // changeOrigin: true, + // // pathRewrite: { '^/api': '' } + // } + }, overlay: { //关闭eslint warnings: false,