2e2c161770
- backed/: Go Fiber backend with cpdaily integration - frondend/: Vue 3 + Vite frontend - Dockerfile: multi-stage build (Node → Go → Alpine) - deploy/docker-compose.yml: production compose file - .woodpecker/build.yml: CI/CD with blue-green zero-downtime deploy - /health endpoint for deployment health checks - Port 8884/8885 blue-green swap via 1Panel OpenResty
26 lines
557 B
Go
26 lines
557 B
Go
package main
|
|
|
|
import (
|
|
"cpdaily-new/internal/config"
|
|
"cpdaily-new/internal/database"
|
|
"cpdaily-new/internal/model"
|
|
"fmt"
|
|
"log"
|
|
|
|
"golang.org/x/crypto/bcrypt"
|
|
)
|
|
|
|
func main() {
|
|
if err := config.Load(""); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
database.Init()
|
|
var agent model.AgentUser
|
|
database.DB.Where("username = ?", "becomer").First(&agent)
|
|
err := bcrypt.CompareHashAndPassword([]byte(agent.Password), []byte("baca122..."))
|
|
if err == nil {
|
|
fmt.Println("✅ 密码验证通过: baca122...")
|
|
} else {
|
|
fmt.Println("❌ 密码验证失败:", err)
|
|
}
|
|
} |