redo web UI |web close| client log |system info |p2p |max、ump optimization

This commit is contained in:
刘河
2019-03-01 17:23:14 +08:00
parent 534d428c6d
commit f526c56784
82 changed files with 15199 additions and 4561 deletions

32
web/controllers/auth.go Normal file
View File

@@ -0,0 +1,32 @@
package controllers
import (
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
)
type AuthController struct {
beego.Controller
}
func (s *AuthController) GetAuthKey() {
m := make(map[string]interface{})
defer func() {
s.Data["json"] = m
s.ServeJSON()
}()
if cryptKey := beego.AppConfig.String("cryptKey"); len(cryptKey) != 16 {
m["status"] = 0
return
} else {
b, err := crypt.AesEncrypt([]byte(beego.AppConfig.String("authKey")), []byte(cryptKey))
if err != nil {
m["status"] = 0
return
}
m["status"] = 1
m["crypt_auth_key"] = string(b)
m["crypt_type"] = "aes cbc"
return
}
}