数据模型使用指针类型字段以避免空值自动更新的问题

This commit is contained in:
2025-05-26 10:57:39 +08:00
parent 1e7b5777a2
commit c08d625975
43 changed files with 457 additions and 397 deletions

View File

@@ -47,7 +47,7 @@ func Identify(c *fiber.Ctx) error {
if err != nil {
return err
}
if user.IDToken != "" {
if user.IDToken != nil && *user.IDToken != "" {
// 用户已实名认证
return c.JSON(IdentifyRes{
Identified: true,
@@ -170,9 +170,9 @@ func IdentifyCallback(c *fiber.Ctx) error {
).
Updates(m.User{
IDType: info.Type,
IDNo: info.IdNo,
IDToken: info.Token,
Name: info.Name,
IDNo: &info.IdNo,
IDToken: &info.Token,
Name: &info.Name,
})
if err != nil {
return err