回放,h5失效

This commit is contained in:
test
2025-09-09 09:59:17 +08:00
parent 5b7c1dd7bd
commit 8c7979c58f
14 changed files with 10088 additions and 479 deletions

32
utils/fileUtil.js Normal file
View File

@@ -0,0 +1,32 @@
import fs from "fs"
function createFile(filePath) {
if (!fs.existsSync(filePath)) {
writeFile(filePath, "")
}
}
function writeFile(filePath, content) {
fs.writeFile(filePath, content, error => {
if (error) {
throw new Error(`${filePath}:写入${content}失败`)
}
})
}
function appendFile(filePath, content) {
fs.appendFile(filePath, content, error => {
if (error) {
throw new Error(`${filePath}:追加${content}失败`)
}
})
}
function appendFileSync(filePath, content) {
fs.appendFileSync(filePath, content, error => {
if (error) {
throw new Error(`${filePath}:同步追加${content}失败`)
}
})
}
export { createFile, writeFile, appendFile, appendFileSync }