feat(theme): 接入云海子主题通道(A 类免插件,规范 v1.12 §2/§3)
build / build (push) Successful in 3m22s

- index.html 插 A 类 loader:唯一接入点,FOUC 门/manifest 预取/主题 link 追加与排序
  全由通道 yh-theme-init.js 承担,主题升级走 /static 通道,本应用无需重新构建
- vite.config 加 /static dev 代理(YH_THEME_PROXY_TARGET 可覆盖,默认线上通道)
- host.config 回写 __APP_CONFIG__.serviceHost(仅同源):init 的 appearance 请求有硬性
  同源限制,跨源会被直接跳过;本地 dev 保持空串走同源 /api 代理
- 顶栏头像接平台键 yh-avatar,监听 yh-appearance-updated,userInfo 兜底
- view-ui-plus 声明锁 1.3.24(对齐通道皮肤生成版本)
This commit is contained in:
lijing
2026-10-21 17:35:24 +08:00
parent 0ca8c08e8d
commit 64de9a0548
6 changed files with 78 additions and 3 deletions
+6
View File
@@ -85,6 +85,12 @@ export default defineConfig((): UserConfig => {
host: "localhost",
port: 8080,
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,
},
// 同源代理:serviceHost 留空时前端走 /api/...,由这里转发到本地 AgentService(8093),
// 规避后端 CAS 过滤器对 /api/* 不回 CORS 头导致的浏览器直连跨域拦截。
// 如需连测试环境:target 换成 http://base.yunhaixingtong.com/agent