mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-21 00:05:49 +00:00
更新大量功能
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user