mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-07 03:22:08 +08:00
fix: 修复vercel无文件创建权限问题 #1796
This commit is contained in:
5
app.js
5
app.js
@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env node
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const tmpPath = require('os').tmpdir()
|
||||
|
||||
async function start() {
|
||||
// 检测是否存在 anonymous_token 文件,没有则生成
|
||||
if (!fs.existsSync('./anonymous_token')) {
|
||||
fs.writeFileSync(path.resolve(__dirname, 'anonymous_token'), '', 'utf-8')
|
||||
if (!fs.existsSync(path.resolve(tmpPath, 'anonymous_token'))) {
|
||||
fs.writeFileSync(path.resolve(tmpPath, 'anonymous_token'), '', 'utf-8')
|
||||
}
|
||||
const generateConfig = require('./generateConfig')
|
||||
await generateConfig()
|
||||
|
Reference in New Issue
Block a user