HaniBlindBox/server/HoneyBox/src/HoneyBox.Model/Models/Auth/WechatPhoneLoginRequest.cs
zpc 3db0764780 feat: 新增微信手机号快速验证登录功能
- 后端新增 POST /api/wxPhoneLogin 接口
- 前端登录页改用微信 getPhoneNumber 授权
- 保留原有微信登录和手机号验证码登录接口
2026-02-11 17:53:15 +08:00

28 lines
778 B
C#
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.

using System.Text.Json.Serialization;
namespace HoneyBox.Model.Models.Auth;
/// <summary>
/// 微信手机号快速验证登录请求
/// </summary>
public class WechatPhoneLoginRequest
{
/// <summary>
/// 微信手机号授权codegetPhoneNumber返回的code
/// </summary>
[JsonPropertyName("code")]
public string Code { get; set; } = string.Empty;
/// <summary>
/// 推荐人ID前端可能传空字符串所以用string接收
/// </summary>
[JsonPropertyName("pid")]
public string? PidStr { get; set; }
/// <summary>
/// 获取推荐人ID转换为int
/// </summary>
[JsonIgnore]
public int? Pid => string.IsNullOrWhiteSpace(PidStr) ? null : int.TryParse(PidStr, out var pid) ? pid : null;
}