更新大量功能

This commit is contained in:
sprov
2021-05-28 17:32:51 +08:00
parent 3cd25ce5ea
commit a66dff6959
41 changed files with 1231 additions and 1009 deletions

View File

@@ -2,15 +2,20 @@ package controller
import (
"github.com/gin-gonic/gin"
"net/http"
"x-ui/web/session"
)
type BaseController struct {
}
func (a *BaseController) before(c *gin.Context) {
func (a *BaseController) checkLogin(c *gin.Context) {
if !session.IsLogin(c) {
pureJsonMsg(c, false, "登录时效已过,请重新登录")
if isAjax(c) {
pureJsonMsg(c, false, "登录时效已过,请重新登录")
} else {
c.Redirect(http.StatusTemporaryRedirect, c.GetString("base_path"))
}
c.Abort()
} else {
c.Next()