Files
quyun-v2/backend/app/http/web/dto/auth.go

29 lines
1.4 KiB
Go
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.
package dto
// LoginForm 平台侧用户登录表单(用于获取 JWT 访问凭证)。
// 注意:此登录是“用户身份”登录(非超级管理员),用于进入租户管理后台前的身份校验与租户列表查询。
type LoginForm struct {
// Username 用户名;必须与数据库 users.username 精确匹配。
Username string `json:"username,omitempty"`
// Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。
Password string `json:"password,omitempty"`
}
// RegisterForm 平台侧用户注册表单(用于创建用户并获取 JWT 访问凭证)。
type RegisterForm struct {
// Username 用户名需全局唯一users.username建议仅允许字母/数字/下划线,且长度在合理范围内。
Username string `json:"username,omitempty"`
// Password 明文密码后端会在创建用户时自动加密bcrypt
Password string `json:"password,omitempty"`
// ConfirmPassword 确认密码;必须与 Password 一致,避免误输入导致无法登录。
ConfirmPassword string `json:"confirmPassword,omitempty"`
// VerifyCode 验证码(预留字段);当前版本仅透传/占位,不做后端校验。
VerifyCode string `json:"verifyCode,omitempty"`
}
// LoginResponse 登录响应。
type LoginResponse struct {
// Token JWT 访问令牌;前端应以 `Authorization: Bearer <token>` 方式携带。
Token string `json:"token"`
}