fix(mini-program): 修复 logo.svg 500 错误
问题: - 小程序请求 /static/logo.svg 返回 500 错误 - logo.svg 文件在 src/static/ 目录,但编译后未被复制到输出目录 修复: 1. 在 mini-program/ 根目录创建 static/ 目录 2. 将 logo.svg 复制到 mini-program/static/logo.svg 3. 修改 vite.config.js 添加 publicDir 配置,让 Vite 复制 static 目录 4. 更新图片路径:/static/logo.svg → /logo.svg - pages/splash/index.vue - pages/main/index.vue 效果: - logo.svg 正确编译到 unpackage/dist/dev/mp-weixin/logo.svg - 小程序正常加载 logo 图片 - 不再出现 500 错误
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<view class="header" :style="{ paddingTop: safeAreaTop + 20 + 'px' }">
|
||||
<view class="header-left">
|
||||
<view class="logo-box">
|
||||
<image class="logo" src="/static/logo.svg" mode="aspectFit" />
|
||||
<image class="logo" src="/logo.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="brand">
|
||||
<text class="brand-title font-serif">人生 OS</text>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class="overlay">
|
||||
<view class="status-bar-space" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||
<view class="content-area" :style="{ paddingBottom: safeAreaBottom + 'px' }">
|
||||
<image class="logo" src="/static/logo.svg" mode="widthFix"></image>
|
||||
<image class="logo" src="/logo.svg" mode="widthFix"></image>
|
||||
<text class="app-name font-serif">人生OS</text>
|
||||
<text class="app-version">LIFE HARMONY v3.1</text>
|
||||
</view>
|
||||
@@ -52,6 +52,12 @@ onLoad(() => {
|
||||
min-height: 100vh;
|
||||
height: 100vh;
|
||||
background: linear-gradient(180deg, #0F071A 0%, #1A0B2E 50%, #0F071A 100%);
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
}
|
||||
|
||||
/* 标题字体 - Cinzel (原型标准) */
|
||||
.app-name.font-serif {
|
||||
font-family: 'Cinzel', 'Inter', serif;
|
||||
}
|
||||
|
||||
.status-bar-space {
|
||||
|
||||
Reference in New Issue
Block a user