Files
bl/login/main.go
昔念 e9b9443c06
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
根据提供的code differences信息,我发现没有具体的代码变更内容。由于缺少实际的代码差异信息,我无法生成准确的commit message。
请提供具体的代码变更内容,以便我能够生成符合Angular规范的中文commit message。

如果确实没有代码变更,可以考虑以下模板:

```
chore(git): 更新git配置或文档

- 添加commit message规范说明
- 配置中文提交信息格式要求
```
2026-03-08 00:07:12 +08:00

190 lines
5.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
"golang.org/x/crypto/bcrypt"
"blazing/common/data/xmlres"
_ "blazing/contrib/files/local"
"blazing/login/internal/cmd"
// Minio按需启用
// _ "blazing/contrib/files/minio"
// 阿里云OSS按需启用
// _ "blazing/contrib/files/oss"
// _ "blazing/contrib/drivers/sqlite"
//_ "blazing/contrib/drivers/mysql"
_ "blazing/modules"
"github.com/gogf/gf/v2/os/gctx"
)
// // 定义XML根节点结构体
// type Root struct {
// XMLName xml.Name `xml:"root"`
// Items []Item `xml:"item"` // 匹配所有item子节点
// }
// // 定义Item节点结构体映射所有属性
// type Item struct {
// ID int `xml:"id,attr"` // 映射id属性
// Level string `xml:"level,attr"` // 映射level属性
// Color string `xml:"color,attr"` // 映射color属性
// Des string `xml:"des,attr"` // 映射des属性
// }
func init() {
xmlres.Initfile()
}
func main() {
// fight.TestSKill()
// // 初始化根结构体
// var root Root
// // 解析XML字符串
// err := xml.Unmarshal(gfile.GetBytes("public/assets/xmltip.xml"), &root)
// if err != nil {
// fmt.Printf("XML解析失败: %v\n", err)
// os.Exit(1)
// }
// // 遍历解析后的Item列表并输出
// fmt.Println("解析结果:")
// for i, item := range root.Items {
// fmt.Printf("第%d个Item:\n", i+1)
// fmt.Printf(" ID: %s\n", item.ID)
// fmt.Printf(" Level: %s\n", item.Level)
// fmt.Printf(" Color: %s\n", item.Color)
// fmt.Printf(" 描述: %s\n\n", item.Des)
// service.NewDictInfoService().SetItemRemark(item.ID, item.Des)
// }
// userInfo, err := service.GetUserInfo("694425176@qq.com", "qq694425176")
// if err != nil {
// log.Fatal(err)
// }
// // 输出结果
// fmt.Printf("用户名: %s\n", userInfo.Data.Attributes.Username)
// fmt.Printf("显示名: %s\n", userInfo.Data.Attributes.DisplayName)
// fmt.Printf("头像: %s\n", userInfo.Data.Attributes.AvatarUrl)
// fmt.Printf("加入时间: %s\n", userInfo.Data.Attributes.JoinTime)
// fmt.Printf("金钱: %.2f\n", userInfo.Data.Attributes.Money)
// fmt.Printf("用户组: %s\n", userInfo.Included[0].Attributes.NameSingular)
// password := "12345678"
// // 哈希密码
// hash, err := HashPassword(password)
// if err != nil {
// log.Fatal(err)
// }
// fmt.Println("哈希结果:", hash)
// hash = "$2y$10$027xtOgP6yG8HRPP5zpNdO1ay1MzaxIeBDdNt73VgE2WWQqTUYih2"
// // 验证密码
// match := CheckPasswordHash(password, hash)
// fmt.Println("密码匹配:", match)
// service.NewShinyService().Args(53)
//player.TestPureMatrixSplit()
// for _, i := range xmlres.ItemsMAP {
// cool.DBM(dict.NewDictInfoService().GetModel()).Insert(
// g.Map{"typeId": 6, "name": i.Name, "remark": i.ID, "ordernum": 1},
// )
// fmt.Println(i.ID, i.Name)
// }
//input.Test()
// element.TestAllScenarios()
// for i := 0; i < 1000000; i++ {
// go func() {
// ff := &info.LeaveMapOutboundInfo{
// 10001,
// }
// t := common.NewTomeeHeader(2002, 10001).Pack(ff)
// if len(t) != 21 {
// panic(t)
// }
// }()
// }
//service.TestSendVerificationCode()
// for i := 0; i < 10; i++ {
// t := model.GenPetInfo(1, 31, 1, 1, 1, 1)
// t.ShinyInfo = make([]model.GlowFilter, 1)
// // 假设 t 是包含 ShinyInfo 字段的结构体ShinyInfo 是 GlowFilter 类型的切片
// t.ShinyInfo[0] = model.GlowFilter{
// // 光晕颜色:白色(十六进制 0xFFFFFF符合 uint32 类型
// Color: 0xFFFFFF,
// // 透明度0.80.0~1.0 范围内的合理值float64 类型)
// Alpha: 0.8,
// // 水平模糊量100~255 范围内uint8 类型略高于默认值6
// BlurX: 10,
// // 垂直模糊量10与 BlurX 对称uint8 类型)
// BlurY: 10,
// // 发光强度80~255 范围内uint8 类型略高于默认值2
// Strength: 8,
// // 滤镜应用次数21~3 范围内int 类型非默认值1
// Quality: 2,
// // 内侧发光truebool 类型,模拟开启内侧发光)
// Inner: true,
// // 挖空falsebool 类型,保持默认逻辑)
// Knockout: false,
// // 颜色矩阵:标准 RGBA 矩阵20个uint8符合 [20]uint8 数组类型)
// // 矩阵含义R=100%、G=100%、B=100%、A=100%,无颜色偏移
// ColorMatrixFilter: [20]uint8{
// 1, 0, 0, 0, 0, // R 通道
// 0, 1, 0, 0, 0, // G 通道
// 0, 0, 1, 0, 0, // B 通道
// 0, 0, 0, 1, 0, // A 通道
// },
// }
// service.NewUserService(10001).Pet.PetAdd(t)
// }
// for i := 0; i < 1000; i++ {
// service.NewUserService(10001).Pet.PetAdd(t)
// }
// service.NewUserService(10001).Pet.PetInfo_One_exec(t.CatchTime, func(pe *model.PetEX) {
// fmt.Println(pe.CreateTime)
// pe.Data.ID = 100
// })
cmd.Main.Run(gctx.New())
}
func kick(id int) {
// // go Start(cool.Config.Port)
// //go rpc()
// go func() {
// t := rpc.StartClient(0, &struct{}{})
// err := t.Kick(1)
// fmt.Println(err)
// //err := t.Kick(1)
// err = t.Kick(10001)
// fmt.Println(err)
// }()
}
// HashPassword 对密码进行 Bcrypt 哈希
func HashPassword(password string) (string, error) {
// bcrypt.DefaultCost = 10与 Laravel 默认一致
bytes, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
return string(bytes), err
}
// CheckPasswordHash 验证密码与哈希是否匹配
func CheckPasswordHash(password, hash string) bool {
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
return err == nil
}