mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
Merge branch 'dev' into new_dev
This commit is contained in:
@@ -2,9 +2,10 @@ package controllers
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"github.com/cnlh/nps/lib/crypt"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/cnlh/nps/lib/crypt"
|
||||
)
|
||||
|
||||
type AuthController struct {
|
||||
|
@@ -1,16 +1,17 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/lib/crypt"
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/server"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"html"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/lib/crypt"
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/server"
|
||||
)
|
||||
|
||||
type BaseController struct {
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/lib/rate"
|
||||
"github.com/cnlh/nps/server"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
type ClientController struct {
|
||||
|
@@ -1,11 +1,12 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/server"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"time"
|
||||
)
|
||||
|
||||
type LoginController struct {
|
||||
@@ -22,7 +23,7 @@ func (self *LoginController) Verify() {
|
||||
if self.GetString("password") == beego.AppConfig.String("web_password") && self.GetString("username") == beego.AppConfig.String("web_username") {
|
||||
self.SetSession("isAdmin", true)
|
||||
auth = true
|
||||
server.Bridge.Register.Store(common.GetIpByAddr(self.Ctx.Request.RemoteAddr), time.Now().Add(time.Hour*time.Duration(2)))
|
||||
server.Bridge.Register.Store(common.GetIpByAddr(self.Ctx.Input.IP()), time.Now().Add(time.Hour*time.Duration(2)))
|
||||
}
|
||||
b, err := beego.AppConfig.Bool("allow_user_login")
|
||||
if err == nil && b && !auth {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/cnlh/nps/web/controllers"
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user