fix(base): 修复QQ绑定功能中用户名查询条件错误 在BindQQ方法中,将数据库查询条件从"id"字段更正为"username"字段, 确保能够正确根据用户名查找和更新用户信息。 ```
This commit is contained in:
26
modules/player/controller/robot/bindqq.go
Normal file
26
modules/player/controller/robot/bindqq.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package robot
|
||||
|
||||
import (
|
||||
"blazing/modules/base/service"
|
||||
"strings"
|
||||
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
)
|
||||
|
||||
func init() {
|
||||
zero.OnCommand("绑定").
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
msgs := strings.Fields(ctx.Event.Message.String())
|
||||
if len(msgs) > 2 {
|
||||
|
||||
err := service.NewBaseSysUserService().BindQQ(msgs[1], msgs[2], ctx.Event.Sender.ID)
|
||||
if err != nil {
|
||||
ctx.Send(err.Error())
|
||||
} else {
|
||||
ctx.Send("绑定成功")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user