Merge branch 'dev' into new_dev

This commit is contained in:
ffdfgdfg
2019-12-01 22:41:59 +08:00
committed by GitHub
332 changed files with 3416 additions and 63358 deletions

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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"
)