Skip to content

Commit

Permalink
fix: 🐛 修复登陆二维码依赖第三方网站被墙的问题 (#269)
Browse files Browse the repository at this point in the history
Closes: #267
  • Loading branch information
danni-cool authored Nov 29, 2024
2 parents 9d0ff47 + 4d70b0f commit 2fe96d2
Show file tree
Hide file tree
Showing 10 changed files with 2,653 additions and 1,937 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ loginSession.memory-card.json
generated
log
tsconfig.tmp.json
packages/cli/lib/bot.js
packages/cli/lib/bot.js
packages/cli/static
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const app = new Hono()
registerRoute({ app, bot })

serve({
hostname: '0.0.0.0',
fetch: app.fetch,
port: Number(PORT)
})
18 changes: 18 additions & 0 deletions packages/cli/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ fs.copyFileSync(
path.join(__dirname, '../.env.example')
)

function copyDirSync(src, dest) {
fs.mkdirSync(dest, { recursive: true });
fs.readdirSync(src).forEach(file => {
const srcPath = path.join(src, file);
const destPath = path.join(dest, file);
if (fs.lstatSync(srcPath).isDirectory()) {
copyDirSync(srcPath, destPath);
} else {
fs.copyFileSync(srcPath, destPath);
}
});
}

copyDirSync(
path.join(__dirname, '../../../static'),
path.join(__dirname, '../static')
)

esbuild
.build({
entryPoints: ['../../main.js'], // 入口文件
Expand Down
Loading

0 comments on commit 2fe96d2

Please sign in to comment.