checkPassword.js 454 B

1234567891011121314151617181920
  1. // scripts/password-check.js
  2. const readline = require('readline');
  3. const rl = readline.createInterface({
  4. input: process.stdin,
  5. output: process.stdout,
  6. });
  7. rl.question('请输入密码: ', (password) => {
  8. rl.close();
  9. if (password === 'admin') {
  10. // 替换为你的实际密码
  11. console.log('密码正确,开始打包...');
  12. process.exit(0);
  13. } else {
  14. console.error('密码错误,打包终止!');
  15. process.exit(1);
  16. }
  17. });