Fix H5 all-in-one asset paths

This commit is contained in:
Chopper711
2026-06-17 16:45:36 +08:00
parent a19f039da4
commit e4e6bd272c
11 changed files with 185 additions and 17 deletions

View File

@@ -0,0 +1,10 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';
const source = readFileSync(new URL('./my.vue', import.meta.url), 'utf8');
test('member center header background resolves under the H5 base path', () => {
assert.doesNotMatch(source, /background-image:\s*url\(["']\/static\/img\/main-bg\.png["']\)/);
assert.match(source, /background-image:\s*url\(["']\.\.\/\.\.\/\.\.\/static\/img\/main-bg\.png["']\)/);
});

View File

@@ -174,7 +174,7 @@ body {
background-size: cover;
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
background-image: url("/static/img/main-bg.png");
background-image: url("../../../static/img/main-bg.png");
background-position: bottom;
background-repeat: no-repeat;
color: #ffffff;