✨ settings
This commit is contained in:
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func Auth(ctx *fiber.Ctx) error {
|
||||
token := ctx.Get("token")
|
||||
token := ctx.Get("Authorization")
|
||||
password, err := model.GetSettingByKey("password")
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
@ -23,6 +23,15 @@ func Auth(ctx *fiber.Ctx) error {
|
||||
return ctx.Next()
|
||||
}
|
||||
|
||||
func Login(ctx *fiber.Ctx) error {
|
||||
return SuccessResp(ctx)
|
||||
}
|
||||
|
||||
func SetSuccess(ctx *fiber.Ctx) error {
|
||||
ctx.Status(200)
|
||||
return ctx.Next()
|
||||
}
|
||||
|
||||
func CheckAccount(ctx *fiber.Ctx) error {
|
||||
if model.AccountsCount() == 0 {
|
||||
return ErrorResp(ctx,fmt.Errorf("no accounts,please add one first"),1001)
|
||||
|
Reference in New Issue
Block a user