diff --git a/.env.dev b/.env.dev
index c83c013..737b7d3 100644
--- a/.env.dev
+++ b/.env.dev
@@ -4,6 +4,10 @@
# API 走 /api 同源相对路径(vite proxy 转发到本地后端 8107),
# 规避后端 CAS 过滤器不回 CORS 头导致的跨域拦截;SSO 用本地 CasService
# (E:\YHXT\java\user-cas-service\CasService,8443 根路径,java -jar target/cas.war)
+# 主题通道(A 类免插件接入 §2):index.html 的 loader 与 vite.config.ts 的 /static 代理已就位,
+# 本地 dev 的 /static/** 由代理兜到线上通道;联调本地通道源时用环境变量覆盖代理目标:
+# YH_THEME_PROXY_TARGET=http://localhost:9527 npm run dev
+
VITE_BASE_HOST=http://base.yunhaixingtong.com
VITE_SSO_HOST=http://sso.yunhaixingtong.com
# 留空 → serviceHost 走同源相对 /api(经 vite 代理到本地后端 8107);填绝对地址会绕过代理直连该域
diff --git a/index.html b/index.html
index 5d7555f..5420b4d 100644
--- a/index.html
+++ b/index.html
@@ -29,6 +29,26 @@
}
})();
+
+
<%- title %>
diff --git a/package.json b/package.json
index aa497da..cc4e447 100644
--- a/package.json
+++ b/package.json
@@ -26,7 +26,7 @@
"pdfjs-dist": "^4.10.38",
"pinia": "^2.1.4",
"sass": "^1.64.1",
- "view-ui-plus": "^1.3.16",
+ "view-ui-plus": "1.3.24",
"vue": "^3.4.19",
"vue-router": "4",
"vuedraggable": "^4.1.0"
diff --git a/src/assets/config/host.config.ts b/src/assets/config/host.config.ts
index 31aebc5..fdca247 100644
--- a/src/assets/config/host.config.ts
+++ b/src/assets/config/host.config.ts
@@ -80,4 +80,30 @@ if (ishttps) {
}
}
+/**
+ * 回写 __APP_CONFIG__.serviceHost(仅同源场景)——云海子 A 类接入 §3 外观三键。
+ * 主题通道 yh-theme-init.js 的 appearance 请求有硬性同源限制:
+ * if (!url || !appearanceSameOrigin(url)) return; → 跨源会被直接跳过、连请求都不发。
+ * 本地 dev:serviceHost 是 VITE_SERVICE_HOST 的绝对地址(跨源),此时不能回写,
+ * 保持空串让 init 走同源 "/api/appearance",由 vite 代理转发到后端。
+ * 生产:serviceHost = 同域 ctx(https://base.../),同源,回写后 init 请求正确前缀。
+ * 已有 env-config 下发值时不动(以平台配置为准)。
+ */
+try {
+ const w = window as any;
+ w.__APP_CONFIG__ = w.__APP_CONFIG__ || {};
+ if (!w.__APP_CONFIG__.serviceHost) {
+ const candidate = conf.serviceHost || "";
+ let sameOrigin = !candidate;
+ try {
+ sameOrigin = new URL(candidate, window.location.href).origin === window.location.origin;
+ } catch {
+ sameOrigin = false;
+ }
+ if (sameOrigin) w.__APP_CONFIG__.serviceHost = candidate;
+ }
+} catch {
+ /* 极端环境无 window:忽略,保持同源兜底 */
+}
+
export default conf;
diff --git a/vite.config.ts b/vite.config.ts
index 83fc604..e002e35 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -94,6 +94,12 @@ export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
host: "localhost",
port: 8078,
proxy: {
+ // 主题通道本地联调(A 类接入 §2.2):默认走线上通道;联调本地通道源用
+ // YH_THEME_PROXY_TARGET=http://localhost:9527 npm run dev
+ "/static": {
+ target: process.env.YH_THEME_PROXY_TARGET || "http://base.yunhaixingtong.com",
+ changeOrigin: true,
+ },
// dev 正式模式:serviceHost 为空(同源相对路径 /api/...),经此代理转发到本地后端
// (后端 CAS 过滤器对 /api/* 不回 CORS 头,浏览器直连会被拦,必须同源代理)
// 教师专业发展后端:本地 Profession(server.port=8107,无 context-path)