调整交易和账单模型,完善支付与用户余额基础处理逻辑

This commit is contained in:
2025-04-09 16:34:41 +08:00
parent 4c47a71f30
commit 02897db890
10 changed files with 203 additions and 85 deletions

View File

@@ -22,6 +22,7 @@ type LoginResp struct {
RefreshToken string `json:"refresh_token"`
Expires int64 `json:"expires"`
Auth services.AuthContext `json:"auth"`
Profile *models.User `json:"profile"`
}
func Login(c *fiber.Ctx) error {
@@ -105,10 +106,12 @@ func loginByPhone(c *fiber.Ctx, req *LoginReq) error {
return err
}
user.Password = ""
return c.JSON(LoginResp{
AccessToken: token.AccessToken,
RefreshToken: token.RefreshToken,
Expires: token.AccessTokenExpires.Unix(),
Auth: auth,
Profile: user,
})
}