chore: add gitignore files and database fix admin user script

add root, server, client gitignore files for different environment ignore rules, and add sql script to fix or initialize admin user with bcrypt encrypted password
This commit is contained in:
2026-05-23 15:12:56 +08:00
parent 1c6599e50f
commit 3f5ea4bffd
4 changed files with 114 additions and 0 deletions

25
.gitignore vendored Normal file
View File

@@ -0,0 +1,25 @@
# IDE
.idea/
.vscode/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db
# Logs
logs/
*.log
npm-debug.log*
# Temp
tmp/
temp/
*.tmp
# Environment
.env
.env.local
.env.*.local

44
client/.gitignore vendored Normal file
View File

@@ -0,0 +1,44 @@
# Dependencies
node_modules/
.pnp
.pnp.js
# Build
dist/
dist-ssr/
*.local
# IDE
.idea/
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# OS
.DS_Store
Thumbs.db
# Test
coverage/
*.lcov
# Environment
.env
.env.local
.env.*.local
# Cache
.cache/
.temp/
*.tmp

View File

@@ -0,0 +1,11 @@
-- 检查是否存在 admin 用户
SELECT * FROM sys_user WHERE username = 'admin';
-- 如果不存在或密码错误,执行以下插入/更新
-- 密码是 admin123使用 BCrypt 加密
INSERT INTO sys_user (username, password, nickname, status, create_time, update_time)
VALUES ('admin', '$2a$10$N.zmdr9k7uOCQb376NoUnuTJ8iAt6Z5EHsM8lE9lBOsl7iAt6Z5EO', '管理员', 1, NOW(), NOW())
ON DUPLICATE KEY UPDATE
password = '$2a$10$N.zmdr9k7uOCQb376NoUnuTJ8iAt6Z5EHsM8lE9lBOsl7iAt6Z5EO',
status = 1,
update_time = NOW();

34
server/.gitignore vendored Normal file
View File

@@ -0,0 +1,34 @@
# Compiled
/target/
*.class
*.jar
*.war
*.ear
# Maven
.mvn/
mvnw
mvnw.cmd
# IDE
.idea/
*.iml
.classpath
.project
.settings/
# Logs
logs/
*.log
# Uploads (local storage files)
uploads/
# Temp
tmp/
temp/
# Environment
application-local.yml
application-dev.yml
application-prod.yml