feat: 环境配置纳入版本管理并更新文档

- 将 .env 和 .env.local 纳入版本管理
- 更新 .gitignore,移除对环境文件的忽略
- 在 README.md 中添加详细的数据库配置和启动说明
- 同步 server/.env 与项目根目录配置
- 修复后端数据库连接问题
This commit is contained in:
selfrelease
2026-06-22 16:00:16 +08:00
parent 97feb42afb
commit 56401ec7ee
22 changed files with 1945 additions and 16 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"fmt"
"golang.org/x/crypto/bcrypt"
)
func main() {
password := "admin123"
hash := "$2a$10$xx3wEU5GY6FbKd4Y7.r7SeyC2872l/bJwsrCx2KMdfWQ.tOHJ7Y4O"
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
if err == nil {
fmt.Println("✅ 密码匹配成功")
} else {
fmt.Printf("❌ 密码不匹配: %v\n", err)
}
// 生成新的哈希测试
newHash, _ := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
fmt.Printf("新生成的哈希: %s\n", string(newHash))
}