feat: 重构认证控制器,统一类型命名为auth
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// @provider
|
||||
type authController struct {
|
||||
type auth struct {
|
||||
app *app.Config
|
||||
jwt *jwt.JWT
|
||||
}
|
||||
@@ -27,7 +27,7 @@ type authController struct {
|
||||
//
|
||||
// @Router /super/v1/auth/login [post]
|
||||
// @Bind form body
|
||||
func (ctl *authController) login(ctx fiber.Ctx, form *dto.LoginForm) (*dto.LoginResponse, error) {
|
||||
func (ctl *auth) login(ctx fiber.Ctx, form *dto.LoginForm) (*dto.LoginResponse, error) {
|
||||
m, err := services.User.FindByUsername(ctx, form.Username)
|
||||
if err != nil {
|
||||
return nil, errorx.Wrap(err).WithMsg("用户名或密码错误")
|
||||
|
||||
Reference in New Issue
Block a user