初始化2
This commit is contained in:
@@ -41,6 +41,24 @@ func (c *AuthController) Login(ctx *gin.Context) {
|
||||
utils.Success(ctx, resp)
|
||||
}
|
||||
|
||||
// AppLogin 应用登录(用户名+appId)
|
||||
// POST /api/auth/app-login
|
||||
func (c *AuthController) AppLogin(ctx *gin.Context) {
|
||||
var req dto.AppLoginRequest
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
utils.BadRequest(ctx, "参数错误: "+err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := c.authService.AppLogin(&req)
|
||||
if err != nil {
|
||||
utils.Unauthorized(ctx, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
utils.Success(ctx, resp)
|
||||
}
|
||||
|
||||
// Register 用户注册
|
||||
// POST /api/auth/register
|
||||
func (c *AuthController) Register(ctx *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user