Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/controller/base.go')
-rw-r--r--web/controller/base.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/controller/base.go b/web/controller/base.go
index 674a195d..492fc2dc 100644
--- a/web/controller/base.go
+++ b/web/controller/base.go
@@ -2,6 +2,7 @@ package controller
import (
"net/http"
+
"x-ui/logger"
"x-ui/web/locale"
"x-ui/web/session"
@@ -9,13 +10,12 @@ import (
"github.com/gin-gonic/gin"
)
-type BaseController struct {
-}
+type BaseController struct{}
func (a *BaseController) checkLogin(c *gin.Context) {
if !session.IsLogin(c) {
if isAjax(c) {
- pureJsonMsg(c, false, I18nWeb(c, "pages.login.loginAgain"))
+ pureJsonMsg(c, http.StatusUnauthorized, false, I18nWeb(c, "pages.login.loginAgain"))
} else {
c.Redirect(http.StatusTemporaryRedirect, c.GetString("base_path"))
}