This commit is contained in:
2026-02-07 16:07:10 +08:00
parent 397d0e8990
commit 1af1771944
95 changed files with 46084 additions and 0 deletions

33
scripts/fix-app-json.js Normal file
View File

@@ -0,0 +1,33 @@
const fs = require('fs')
const path = require('path')
// 修复 dist/app.json确保 tabBar.list 存在
const appJsonPath = path.join(__dirname, '../dist/app.json')
if (fs.existsSync(appJsonPath)) {
const appJson = JSON.parse(fs.readFileSync(appJsonPath, 'utf8'))
// 如果 tabBar 存在但没有 list添加 list
if (appJson.tabBar && !appJson.tabBar.list) {
appJson.tabBar.list = [
{
pagePath: 'pages/home/index',
text: '首页',
iconPath: 'assets/tabbar/home.png',
selectedIconPath: 'assets/tabbar/home-active.png'
},
{
pagePath: 'pages/check/index',
text: '质检',
iconPath: 'assets/tabbar/check.png',
selectedIconPath: 'assets/tabbar/check-active.png'
}
]
fs.writeFileSync(appJsonPath, JSON.stringify(appJson, null, 2), 'utf8')
console.log('✅ 已修复 dist/app.json 中的 tabBar.list')
}
} else {
console.log('⚠️ dist/app.json 不存在,跳过修复')
}