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

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

@@ -4,6 +4,7 @@ import (
"encoding/base64"
"errors"
"log/slog"
"platform/pkg/u"
auth2 "platform/web/auth"
client2 "platform/web/domains/client"
m "platform/web/models"
@@ -328,8 +329,8 @@ func Introspect(c *fiber.Ctx) error {
if profile.Phone != "" {
profile.Phone = maskPhone(profile.Phone)
}
if profile.IDNo != "" {
profile.IDNo = maskIdNo(profile.IDNo)
if profile.IDNo != nil && *profile.IDNo != "" {
profile.IDNo = u.P(maskIdNo(*profile.IDNo))
}
return c.JSON(IntrospectResp{*profile})
}